From 4d0977186233ef43067a336b858a6f7ebba64e99 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 21 Jan 2003 20:43:53 +0100 Subject: [PATCH] 990208-1.c: Add noinline attributes as needed. * gcc.c-torture/execute/990208-1.c: Add noinline attributes as needed. * gcc.c-torture/execute/eeprof-1.c: Likewise. * gcc.c-torture/execute/stdio-opt-*.c: Likewise. * gcc.c-torture/execute/string-opt-*.c: Likewise. From-SVN: r61563 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.c-torture/execute/990208-1.c | 3 +++ gcc/testsuite/gcc.c-torture/execute/eeprof-1.c | 6 ++++++ gcc/testsuite/gcc.c-torture/execute/pure-1.c | 1 + gcc/testsuite/gcc.c-torture/execute/stdio-opt-1.c | 1 + gcc/testsuite/gcc.c-torture/execute/stdio-opt-2.c | 1 + gcc/testsuite/gcc.c-torture/execute/stdio-opt-3.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-1.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-10.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-11.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-12.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-13.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-14.c | 2 ++ gcc/testsuite/gcc.c-torture/execute/string-opt-15.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-16.c | 2 ++ gcc/testsuite/gcc.c-torture/execute/string-opt-17.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-2.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-3.c | 3 +++ gcc/testsuite/gcc.c-torture/execute/string-opt-4.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-6.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-7.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-8.c | 1 + gcc/testsuite/gcc.c-torture/execute/string-opt-9.c | 1 + 23 files changed, 40 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3f53ca43469..6144f2d3956 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +Tue Jan 21 18:01:35 CET 2003 Jan Hubicka + + * gcc.c-torture/execute/990208-1.c: Add noinline attributes as needed. + * gcc.c-torture/execute/eeprof-1.c: Likewise. + * gcc.c-torture/execute/stdio-opt-*.c: Likewise. + * gcc.c-torture/execute/string-opt-*.c: Likewise. + 2003-01-20 Nick Clifton * gcc.c-torture/execute/20030117-1.c: New test case. Exposes diff --git a/gcc/testsuite/gcc.c-torture/execute/990208-1.c b/gcc/testsuite/gcc.c-torture/execute/990208-1.c index 9d7d7140323..786e664f35b 100644 --- a/gcc/testsuite/gcc.c-torture/execute/990208-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/990208-1.c @@ -14,16 +14,19 @@ static __inline__ void doit(void **pptr, int cond) } } +__attribute__ ((noinline)) static void f(int cond) { doit (&ptr1, cond); } +__attribute__ ((noinline)) static void g(int cond) { doit (&ptr2, cond); } +__attribute__ ((noinline)) static void bar(void); int main() diff --git a/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c b/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c index 6dad7ec5a73..248b8ccbe01 100644 --- a/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c @@ -5,13 +5,16 @@ int entry_calls, exit_calls; void (*last_fn_entered)(); void (*last_fn_exited)(); +__attribute__ ((noinline)) int main () NOCHK; +__attribute__ ((noinline)) void foo () { ASSERT (last_fn_entered == foo); } +__attribute__ ((noinline)) static void foo2 () { ASSERT (entry_calls == 1 && exit_calls == 0); @@ -22,6 +25,7 @@ static void foo2 () ASSERT (last_fn_exited == foo); } +__attribute__ ((noinline)) void nfoo (void) NOCHK; void nfoo () { @@ -55,11 +59,13 @@ int main () void __cyg_profile_func_enter (void (*fn)(), void (*parent)()) NOCHK; void __cyg_profile_func_exit (void (*fn)(), void (*parent)()) NOCHK; +__attribute__ ((noinline)) void __cyg_profile_func_enter (void (*fn)(), void (*parent)()) { entry_calls++; last_fn_entered = fn; } +__attribute__ ((noinline)) void __cyg_profile_func_exit (void (*fn)(), void (*parent)()) { exit_calls++; diff --git a/gcc/testsuite/gcc.c-torture/execute/pure-1.c b/gcc/testsuite/gcc.c-torture/execute/pure-1.c index a516ed940c3..174477e57b3 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pure-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/pure-1.c @@ -1,3 +1,4 @@ + /* Origin: Kaveh Ghazi 2002-05-27. */ /* Use a different function for each test so the link failures diff --git a/gcc/testsuite/gcc.c-torture/execute/stdio-opt-1.c b/gcc/testsuite/gcc.c-torture/execute/stdio-opt-1.c index dbdc812fe6b..f5316d41863 100644 --- a/gcc/testsuite/gcc.c-torture/execute/stdio-opt-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/stdio-opt-1.c @@ -58,6 +58,7 @@ int main() /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static int fputs(const char *string, FILE *stream) { diff --git a/gcc/testsuite/gcc.c-torture/execute/stdio-opt-2.c b/gcc/testsuite/gcc.c-torture/execute/stdio-opt-2.c index e917205c249..833017ee547 100644 --- a/gcc/testsuite/gcc.c-torture/execute/stdio-opt-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/stdio-opt-2.c @@ -45,6 +45,7 @@ int main() /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static int printf (const char *string, ...) { diff --git a/gcc/testsuite/gcc.c-torture/execute/stdio-opt-3.c b/gcc/testsuite/gcc.c-torture/execute/stdio-opt-3.c index fb56a3ff540..afc76a21716 100644 --- a/gcc/testsuite/gcc.c-torture/execute/stdio-opt-3.c +++ b/gcc/testsuite/gcc.c-torture/execute/stdio-opt-3.c @@ -57,6 +57,7 @@ int main() /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static int fprintf (FILE *stream, const char *string, ...) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-1.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-1.c index 2210a04e297..6b59c10f29b 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-1.c @@ -37,6 +37,7 @@ int main() /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static char * strstr(const char *s1, const char *s2) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-10.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-10.c index e1a271d0aeb..dc31dc5fb7d 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-10.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-10.c @@ -76,6 +76,7 @@ int main () /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static char * strncat (char *s1, const char *s2, size_t n) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-11.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-11.c index cad19c945b2..0aa186299df 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-11.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-11.c @@ -58,6 +58,7 @@ int main () /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static size_t strspn (const char *s1, const char *s2) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-12.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-12.c index b9df9c2d1cb..1d20f1e6708 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-12.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-12.c @@ -58,6 +58,7 @@ int main () /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static size_t strcspn (const char *s1, const char *s2) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-13.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-13.c index 3060f911ff3..9d79ef0d817 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-13.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-13.c @@ -49,6 +49,7 @@ main () /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static size_t strlen (const char *s) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-14.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-14.c index f1b7bfb1e57..cb0bfcb9dff 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-14.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-14.c @@ -25,12 +25,14 @@ main () something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static void * memset (void *s, int c, size_t n) { abort (); } +__attribute__ ((noinline)) static void * memcpy (void *dest, const void *src, size_t n) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-15.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-15.c index b08ff9b66e5..2cf73da151c 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-15.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-15.c @@ -37,6 +37,7 @@ main () /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static int memcmp (const char *p1, const char *p2, size_t len) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-16.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-16.c index a28cdb04271..2948b641b4c 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-16.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-16.c @@ -28,6 +28,7 @@ main (int argc) /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static int memcmp (const void *s1, const void *s2, size_t len) { @@ -36,6 +37,7 @@ memcmp (const void *s1, const void *s2, size_t len) #else /* When not optimizing, the above tests may generate references to the function link_error, but should never actually call it. */ +__attribute__ ((noinline)) static void link_error () { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-17.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-17.c index 47fe42db628..744f1462927 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-17.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-17.c @@ -40,6 +40,7 @@ main (int argc) /* When optimizing, most of the above cases should be transformed into something else. So any remaining calls to the original function for short lengths should abort. */ +__attribute__ ((noinline)) static void * memset (void *dst, int c, size_t len) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-2.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-2.c index 7b9bcbf873d..d8ebb77be51 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-2.c @@ -46,6 +46,7 @@ int main() /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static char * strpbrk(const char *s1, const char *s2) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-3.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-3.c index 61718f2900f..c6f019b4551 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-3.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-3.c @@ -104,18 +104,21 @@ rindex (const char *s, int c) /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static __SIZE_TYPE__ strlen (const char *s) { abort (); } +__attribute__ ((noinline)) static int strcmp (const char *s1, const char *s2) { abort (); } +__attribute__ ((noinline)) static char * strrchr (const char *s, int c) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-4.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-4.c index d82bb69a2ab..9182eb27838 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-4.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-4.c @@ -53,6 +53,7 @@ index (const char *s, int c) /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static char * strchr (const char *s, int c) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-6.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-6.c index efd502f7b83..c684dbd4f13 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-6.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-6.c @@ -45,6 +45,7 @@ int main() /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static char * strcpy (char *d, const char *s) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-7.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-7.c index 144d9f11072..ed1b2a4095a 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-7.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-7.c @@ -69,6 +69,7 @@ int main () /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static char * strncpy(char *s1, const char *s2, size_t n) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c index 0e0e7bb5fb8..8fef5b53734 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c @@ -231,6 +231,7 @@ int main () /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static int strncmp(const char *s1, const char *s2, size_t n) { diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-9.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-9.c index ba248a06ad7..0a3edbeb99e 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-9.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-9.c @@ -46,6 +46,7 @@ int main () /* When optimizing, all the above cases should be transformed into something else. So any remaining calls to the original function should abort. */ +__attribute__ ((noinline)) static char * strcat (char *s1, const char *s2) { -- 2.30.2