From 3b33b1136d5ba1903a56fa601a848accc3db46ef Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 22 Jun 2021 14:15:45 +0800 Subject: [PATCH] testsuite: mips: use noinline attribute instead of -fno-inline mips.exp does not support -fno-inline, causing the tests return "ERROR: Unrecognised option: -fno-inline for dg-options ... ". Use noinline attribute like other mips target tests, to workaround it. gcc/testsuite/ * gcc.target/mips/cfgcleanup-jalr2.c: Remove -fno-inline and add __attribute__((noinline)). * gcc.target/mips/cfgcleanup-jalr3.c: Likewise. --- gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c | 11 ++++++++--- gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c index bf22f06..6a9f86a 100644 --- a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c +++ b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c @@ -1,10 +1,15 @@ /* { dg-do compile } */ -/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fno-inline -fipa-ra -mcompact-branches=never" } */ +/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fipa-ra -mcompact-branches=never" } */ /* { dg-skip-if "needs codesize optimization" { *-*-* } { "-O0" "-O1" "-O2" "-O3" } { "" } } */ -static int foo (void* p) { __asm__ (""::"r"(p):"$t0"); return 0; } +static int __attribute__((noinline)) +foo (void* p) +{ + __asm__ (""::"r"(p):"$t0"); + return 0; +} -static int bar (void* p) { return 1; } +__attribute__((noinline)) static int bar (void* p) { return 1; } int test (void* p) diff --git a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c index 805b31a..5093741 100644 --- a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c +++ b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c @@ -1,10 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fno-inline -fipa-ra -mcompact-branches=never" } */ +/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fipa-ra -mcompact-branches=never" } */ /* { dg-skip-if "needs codesize optimization" { *-*-* } { "-O0" "-O1" "-O2" "-O3" } { "" } } */ -static int foo (void* p) { return 0; } +__attribute__((noinline)) static int foo (void* p) { return 0; } -static int bar (void* p) { return 1; } +__attribute__((noinline)) static int bar (void* p) { return 1; } int test (void* p) -- 2.7.4