diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/assign-warn-3.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/nested-func-6.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr33826.c | 41 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr34003-1.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr34003-2.c | 20 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tf_to_di-1.c | 47 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/loop-3.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c | 2 |
9 files changed, 135 insertions, 11 deletions
diff --git a/gcc/testsuite/gcc.dg/assign-warn-3.c b/gcc/testsuite/gcc.dg/assign-warn-3.c index 1463fce0f68..4ff7b88fa5f 100644 --- a/gcc/testsuite/gcc.dg/assign-warn-3.c +++ b/gcc/testsuite/gcc.dg/assign-warn-3.c @@ -5,9 +5,9 @@ /* { dg-options "-O3 -std=c99 -pedantic-errors" } */ /* This is valid to execute, so maybe shouldn't warn at all. */ -void f0(x) signed char *x; { } +static inline void f0(x) signed char *x; { } void g0(unsigned char *x) { f0(x); } /* { dg-warning "warning: pointer targets in passing argument 1 of 'f0' differ in signedness" } */ /* This is undefined on execution but still must compile. */ -void f1(x) int *x; { } +static inline void f1(x) int *x; { } void g1(unsigned int *x) { f1(x); } /* { dg-warning "warning: pointer targets in passing argument 1 of 'f1' differ in signedness" } */ diff --git a/gcc/testsuite/gcc.dg/nested-func-6.c b/gcc/testsuite/gcc.dg/nested-func-6.c new file mode 100644 index 00000000000..3bae4db352e --- /dev/null +++ b/gcc/testsuite/gcc.dg/nested-func-6.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O -Winline" } */ + +static inline int foo1 (int a) +{ /* { dg-bogus "function not inlinable" } */ + void bar1 (int b) + {} + return a; +} + +int foo2 (int a) +{ + return foo1 (a); +} diff --git a/gcc/testsuite/gcc.dg/pr33826.c b/gcc/testsuite/gcc.dg/pr33826.c new file mode 100644 index 00000000000..3e08b14fa97 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr33826.c @@ -0,0 +1,41 @@ +/* Regression test for PR middle-end/33826 */ +/* Verify that recursive functions cannot be pure or const. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target nonpic } */ +/* { dg-options "-O1 -fdump-ipa-pure-const" } */ + +int recurese1 (int i) +{ + return recurse1 (i+1); +} + +int recurse2a (int i) +{ + return recurse2b (i+1); +} + +int recurse2b (int i) +{ + return recurse2a (i+1); +} + +int norecurse1a (int i) +{ + return norecurse1b (i+1); +} + +int norecurse1b (int i) +{ + return i+1; +} + +/* { dg-final { scan-ipa-dump "found to be const: norecurse1a" "pure-const" } } */ +/* { dg-final { scan-ipa-dump "found to be const: norecurse1b" "pure-const" } } */ +/* { dg-final { scan-ipa-dump-not "found to be pure: recurse1" "pure-const" } } */ +/* { dg-final { scan-ipa-dump-not "found to be pure: recurse2a" "pure-const" } } */ +/* { dg-final { scan-ipa-dump-not "found to be pure: recurse2b" "pure-const" } } */ +/* { dg-final { scan-ipa-dump-not "found to be const: recurse1" "pure-const" } } */ +/* { dg-final { scan-ipa-dump-not "found to be const: recurse2a" "pure-const" } } */ +/* { dg-final { scan-ipa-dump-not "found to be const: recurse2b" "pure-const" } } */ +/* { dg-final { cleanup-ipa-dump "pure-const" } } */ diff --git a/gcc/testsuite/gcc.dg/pr34003-1.c b/gcc/testsuite/gcc.dg/pr34003-1.c new file mode 100644 index 00000000000..ff97fe6d23e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr34003-1.c @@ -0,0 +1,8 @@ +/* PR bootstrap/34003 */ +/* { dg-do link } */ +/* { dg-options "-O0" } */ +/* { dg-additional-sources "pr34003-2.c" } */ + +extern void foo (void); +int bar (void) { foo (); return 1; } +extern void foo (void); diff --git a/gcc/testsuite/gcc.dg/pr34003-2.c b/gcc/testsuite/gcc.dg/pr34003-2.c new file mode 100644 index 00000000000..a5330567f50 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr34003-2.c @@ -0,0 +1,20 @@ +/* PR bootstrap/34003 */ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +extern void abort (void); + +int seen = 0; + +void foo (void) +{ + ++seen; +} + +int main (void) +{ + extern int bar (void); + if (bar () != 1 || seen != 1) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tf_to_di-1.c b/gcc/testsuite/gcc.dg/tf_to_di-1.c new file mode 100644 index 00000000000..f4f478a0f7c --- /dev/null +++ b/gcc/testsuite/gcc.dg/tf_to_di-1.c @@ -0,0 +1,47 @@ +/* { dg-do run { target s390*-*-* } } */ +/* { dg-options "-O0 -mlong-double-128" } */ + +#include <stdio.h> +#include <stdlib.h> + +void +check_ll (long double ld, long long ll) +{ + if ((long long)ld != ll) + { + printf ("ld: %Lf expect: %lld result: %lld\n", + ld, ll, (long long)ld); + abort (); + } +} + +void +check_ull (long double ld, unsigned long long ull) +{ + if ((unsigned long long)ld != ull) + { + printf ("ld: %Lf expect: %llu result: %llu\n", + ld, ull, (unsigned long long)ld); + abort (); + } +} + +int +main () +{ + const long long ll_max = (long long)((1ULL << 63) - 1); + const long long ll_min = -ll_max - 1; + + check_ll (206.23253, 206LL); + check_ull (206.23253, 206ULL); + check_ll ((long double)ll_max, ll_max); + check_ull ((long double)ll_max, ll_max); + check_ll ((long double)ll_min, ll_min); + check_ll (0.0, 0); + check_ull (0.0, 0); + check_ll (-1.0, -1); + check_ll ((long double)0xffffffffffffffffULL, ll_max); + check_ull ((long double)0xffffffffffffffffULL, 0xffffffffffffffffULL); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c index 34fb26697d3..a48cfdb7596 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c @@ -34,13 +34,6 @@ find_base_value (src) } -/* There should be four IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 4 "dom3"} } */ - /* There should be no casts to short unsigned int. */ /* { dg-final { scan-tree-dump-times "\\(short unsigned int\\)" 0 "dom3"} } */ -/* There should be two loads of ->code. */ -/* { dg-final { scan-tree-dump-times "->code" 2 "dom3"} } */ - -/* { dg-final { cleanup-tree-dump "dom3" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c index 82d1d2d73c5..c71791480c6 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c @@ -3,7 +3,8 @@ assume something about memory addressing modes. */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O1 -fdump-tree-vars" } */ +/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-fpic" "-fPIC" } { "" } } */ +/* { dg-options "-O1 -fno-pic -fno-PIC -fdump-tree-vars" } */ int arr_base[100]; diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c index 75941d7f10f..b4a74cf9b44 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c +++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c @@ -11,7 +11,7 @@ extern void abort(void); int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; int B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0}; -void foo () __attribute__((always_inline)); +inline void foo () __attribute__((always_inline)); void foo () { int i, j; |