diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-27 12:45:13 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-27 12:45:13 +0000 |
commit | 268b9e9e95f56a59a8817b28ad59b53f40fc668d (patch) | |
tree | 5e9529982daf11d5b3ab800d4c58bc3fbee99d28 /gcc/testsuite/gcc.dg | |
parent | e1910362719612f58bd1ea5050fa7a5175036abc (diff) | |
download | gcc-268b9e9e95f56a59a8817b28ad59b53f40fc668d.tar.gz |
2009-04-27 Basile Starynkevitch <basile@starynkevitch.net>
MERGED WITH TRUNK r146824::
* gcc/basilys.h: all GTY goes before the identifiers.
* gcc/basilys.c: removed errors.h include.
* gcc/run-basilys.h: ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@146839 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
156 files changed, 3511 insertions, 235 deletions
diff --git a/gcc/testsuite/gcc.dg/README b/gcc/testsuite/gcc.dg/README index 6f14899edf9..3a3d8ef6118 100644 --- a/gcc/testsuite/gcc.dg/README +++ b/gcc/testsuite/gcc.dg/README @@ -13,4 +13,11 @@ Notes for testsuite/gcc.dg. 3) Remember DOS file name restrictions (8.3). Sigh. -4) Send bugs, comments, etc. to dje@cygnus.com.
\ No newline at end of file +4) Send bugs, comments, etc. to dje@cygnus.com. + + +Copyright (C) 1997, 1998 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-3.c b/gcc/testsuite/gcc.dg/Wcxx-compat-3.c new file mode 100644 index 00000000000..306167314e8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wcxx-compat-3.c @@ -0,0 +1,46 @@ +/* { dg-do compile } */ +/* { dg-options "-Wc++-compat" } */ +enum E1 { A, B, C }; +enum E2 { D, E, F }; +extern void f2 (enum E1); + +void +f1 () +{ + int a = A; + enum E1 e1; + enum E2 e2; + + f2 (0); /* { dg-warning "invalid in C\[+\]\[+\]" } */ + f2 (A); + f2 (D); /* { dg-warning "invalid in C\[+\]\[+\]" } */ + f2 (a); /* { dg-warning "invalid in C\[+\]\[+\]" } */ + f2 (e1); + f2 (e2); /* { dg-warning "invalid in C\[+\]\[+\]" } */ + f2 ((A)); + f2 (a ? A : B); + f2 ((enum E1) 0); + f2 ((enum E1) D); + f2 ((enum E1) a); + f2 ((enum E1) e2); +} + +struct s1 { enum E1 e1 : 3; }; +struct s2 { enum E2 e2 : 3; }; + +void +f3 (struct s1 sv1, struct s2 sv2) +{ + f2 (sv1.e1); + f2 (sv2.e2); /* { dg-warning "invalid in C\[+\]\[+\]" } */ +} + +void +f4 (struct s1 *pv1, struct s2 *pv2) +{ + f2 (pv1->e1); + f2 (pv2->e2); /* { dg-warning "invalid in C\[+\]\[+\]" } */ +} + +/* Match all extra informative notes. */ +/* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-4.c b/gcc/testsuite/gcc.dg/Wcxx-compat-4.c new file mode 100644 index 00000000000..a294ffe0b81 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wcxx-compat-4.c @@ -0,0 +1,49 @@ +/* { dg-do compile } */ +/* { dg-options "-Wc++-compat" } */ +enum E1 { A, B, C }; +enum E2 { D, E, F }; + +enum E1 g1; +enum E2 g2; + +void +f1 () +{ + int a; + int d; + enum E1 e1; + enum E2 e2; + a = A; + a = !B; + d = E; + e1 = A; + e1 = D; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + e1 = 0; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + e1 = (enum E1) 0; + e1 = (enum E2) 0; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + e1 = e2; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + e1 = g1; + e1 = g2; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + e2 = A; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + e2 = D; +} + +struct s { enum E1 e1 : 3; }; + +void +f2 (struct s sv) +{ + sv.e1 = A; + sv.e1 = D; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + g1 = sv.e1; + g2 = sv.e1; /* { dg-warning "invalid in C\[+\]\[+\]" } */ +} + +void +f3 (struct s *pv) +{ + pv->e1 = A; + pv->e1 = D; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + g1 = pv->e1; + g2 = pv->e1; /* { dg-warning "invalid in C\[+\]\[+\]" } */ +} diff --git a/gcc/testsuite/gcc.dg/Wenum-compare-1.c b/gcc/testsuite/gcc.dg/Wenum-compare-1.c new file mode 100644 index 00000000000..dd321e0f643 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wenum-compare-1.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-Wenum-compare" } */ +enum E1 { A, B, C }; +enum E2 { D, E, F }; +extern void f2 (); +void +f1 () +{ + int a = A; + int d = D; + enum E1 e1 = A; + enum E2 e2 = D; + if (A > D) /* { dg-warning "comparison between .enum E1. and .enum E2." } */ + f2 (); + if (e1 > e2) /* { dg-warning "comparison between .enum E1. and .enum E2." } */ + f2 (); + if (e1 > e2 + 1) + f2 (); + if (A > 0) + f2 (); + if (e1 > 0) + f2 (); + if (A + D > 0) + f2 (); + if (e1 > 0) + f2 (); + if (A + D > 0) + f2 (); + if ((int) A > D) + f2 (); + if ((int) e1 > e2) + f2 (); +} diff --git a/gcc/testsuite/gcc.dg/Wlogical-op-1.c b/gcc/testsuite/gcc.dg/Wlogical-op-1.c index d9687bf09a2..2cbb9806e03 100644 --- a/gcc/testsuite/gcc.dg/Wlogical-op-1.c +++ b/gcc/testsuite/gcc.dg/Wlogical-op-1.c @@ -14,34 +14,64 @@ extern int testa(); void foo() { - if ( testa() && b ) /* { dg-warning "always evaluate as" } */ + if ( testa() && b ) /* { dg-warning "logical" } */ (void)testa(); - if ( c && b ) /* { dg-warning "always evaluate as" } */ + if ( c && b ) /* { dg-warning "logical" } */ (void)testa(); - if ( c && 0x42 ) /* { dg-warning "always evaluate as" } */ + if ( c && 0x42 ) /* { dg-warning "logical" } */ (void)testa(); - if ( c && 0x42 ) /* { dg-warning "always evaluate as" } */ + if ( c && 0x80 >>6) /* { dg-warning "logical" } */ + (void)testa(); + + + if ( b && c == a ) /* { dg-bogus "logical" } */ + (void)testa(); + + if ( 1 && c ) /* { dg-bogus "logical" } */ + (void)testa(); + + if ( t2 && b ) /* { dg-bogus "logical" } */ + (void)testa(); + + if ( 0 && c == a ) /* { dg-bogus "logical" } */ + (void)testa(); + + if ( b && 1 ) /* { dg-bogus "logical" } */ + (void)testa(); +} + + +void bar() +{ + if ( testa() || b ) /* { dg-warning "logical" } */ + (void)testa(); + + if ( c || b ) /* { dg-warning "logical" } */ + (void)testa(); + + if ( c || 0x42 ) /* { dg-warning "logical" } */ (void) testa(); - if ( c && 0x80 >>6) /* { dg-warning "always evaluate as" } */ + if ( c || 0x80 >>6) /* { dg-warning "logical" } */ (void)testa(); - if ( b && c == a ) /* { dg-bogus "always evaluate as" } */ + if ( b || c == a ) /* { dg-bogus "logical" } */ (void)testa(); - if ( 1 && c ) /* { dg-bogus "always evaluate as" } */ + if ( 1 || c ) /* { dg-bogus "logical" } */ (void)testa(); - if ( t2 && b ) /* { dg-bogus "always evaluate as" } */ + if ( t2 || b ) /* { dg-bogus "logical" } */ (void)testa(); - if ( 0 && c == a ) /* { dg-bogus "always evaluate as" } */ + if ( 0 || c == a ) /* { dg-bogus "logical" } */ (void)testa(); - if ( b && 1 ) /* { dg-bogus "always evaluate as" } */ + if ( b || 1 ) /* { dg-bogus "logical" } */ (void)testa(); } + diff --git a/gcc/testsuite/gcc.dg/Wunused-value-3.c b/gcc/testsuite/gcc.dg/Wunused-value-3.c new file mode 100644 index 00000000000..333ddea4ffd --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wunused-value-3.c @@ -0,0 +1,9 @@ +/* PR c/39889 */ +/* { dg-do compile } */ +/* { dg-options "-Wunused-value" } */ + +int x; +int foo (void) +{ + return (1 ? x = 0 : (void) 0), 0; /* { dg-bogus "value computed is not used" } */ +} diff --git a/gcc/testsuite/gcc.dg/array-const-1.c b/gcc/testsuite/gcc.dg/array-const-1.c new file mode 100644 index 00000000000..0e0c46224cf --- /dev/null +++ b/gcc/testsuite/gcc.dg/array-const-1.c @@ -0,0 +1,8 @@ +/* Test for array designators not integer constant expressions but + folding to integer constants (used in Linux kernel, + <http://gcc.gnu.org/ml/gcc/2009-04/msg00611.html>). */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +extern int i; +int a[] = { [1 ? 1 : i] = 0 }; diff --git a/gcc/testsuite/gcc.dg/array-const-2.c b/gcc/testsuite/gcc.dg/array-const-2.c new file mode 100644 index 00000000000..f6e2bd5bbfa --- /dev/null +++ b/gcc/testsuite/gcc.dg/array-const-2.c @@ -0,0 +1,9 @@ +/* Test for array designators not integer constant expressions but + folding to integer constants (used in Linux kernel, + <http://gcc.gnu.org/ml/gcc/2009-04/msg00611.html>). */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99 -pedantic" } */ + +extern int i; +int a[] = { [1 ? 1 : i] = 0 }; /* { dg-warning "array index in initializer is not an integer constant expression" } */ +/* { dg-warning "near initialization" "near init" { target *-*-* } 8 } */ diff --git a/gcc/testsuite/gcc.dg/array-const-3.c b/gcc/testsuite/gcc.dg/array-const-3.c new file mode 100644 index 00000000000..5bb215cbd0f --- /dev/null +++ b/gcc/testsuite/gcc.dg/array-const-3.c @@ -0,0 +1,9 @@ +/* Test for array designators not integer constant expressions but + folding to integer constants (used in Linux kernel, + <http://gcc.gnu.org/ml/gcc/2009-04/msg00611.html>). */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99 -pedantic-errors" } */ + +extern int i; +int a[] = { [1 ? 1 : i] = 0 }; /* { dg-error "array index in initializer is not an integer constant expression" } */ +/* { dg-error "near initialization" "near init" { target *-*-* } 8 } */ diff --git a/gcc/testsuite/gcc.dg/autopar/parallelization-1.c b/gcc/testsuite/gcc.dg/autopar/parallelization-1.c index ee62ff666b8..f71d6d53343 100644 --- a/gcc/testsuite/gcc.dg/autopar/parallelization-1.c +++ b/gcc/testsuite/gcc.dg/autopar/parallelization-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ void abort (void); @@ -28,6 +28,6 @@ int main(void) /* Check that the first loop in parloop got parallelized. */ /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */ -/* { dg-final { scan-tree-dump-times "loopfn" 5 "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1.c b/gcc/testsuite/gcc.dg/autopar/reduc-1.c index ac08d3d2e47..c8b624c8c5b 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-1.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include <stdarg.h> #include <stdlib.h> @@ -54,5 +54,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */ /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1char.c b/gcc/testsuite/gcc.dg/autopar/reduc-1char.c index 228e97995a7..e3c73ba0d57 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-1char.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-1char.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include <stdarg.h> #include <stdlib.h> @@ -49,5 +49,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */ /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1short.c b/gcc/testsuite/gcc.dg/autopar/reduc-1short.c index 45d96fdc926..10f1401d5c9 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-1short.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-1short.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include <stdarg.h> #include <stdlib.h> @@ -49,5 +49,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */ /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2.c b/gcc/testsuite/gcc.dg/autopar/reduc-2.c index 684094d6319..8a0338f1c6a 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-2.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include <stdarg.h> #include <stdlib.h> @@ -51,5 +51,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */ /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2char.c b/gcc/testsuite/gcc.dg/autopar/reduc-2char.c index 78e5b13aca2..0372dc6a2b2 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-2char.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-2char.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include <stdarg.h> #include <stdlib.h> @@ -49,6 +49,6 @@ int main (void) /* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */ /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2short.c b/gcc/testsuite/gcc.dg/autopar/reduc-2short.c index cef179b7f53..4f37e864192 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-2short.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-2short.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include <stdarg.h> #include <stdlib.h> @@ -48,5 +48,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */ /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-3.c b/gcc/testsuite/gcc.dg/autopar/reduc-3.c index 97501c61584..0ec3aaa8102 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-3.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include <stdarg.h> #include <stdlib.h> @@ -39,5 +39,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "Detected reduction" 1 "parloops" } } */ /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-6.c b/gcc/testsuite/gcc.dg/autopar/reduc-6.c index b3a28a965b5..f6d503c9be4 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-6.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-6.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include <stdarg.h> #include <stdlib.h> @@ -52,4 +52,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */ /* { dg-final { scan-tree-dump-times "FAILED: it is not a part of reduction" 3 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-7.c b/gcc/testsuite/gcc.dg/autopar/reduc-7.c index 90bbc9806c7..f25b03abb6d 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-7.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include <stdlib.h> @@ -78,5 +78,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */ /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-8.c b/gcc/testsuite/gcc.dg/autopar/reduc-8.c index 4801dc782cc..801561da87d 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-8.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-8.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include <stdlib.h> @@ -77,4 +77,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */ /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-9.c b/gcc/testsuite/gcc.dg/autopar/reduc-9.c index 68ed1de6175..2bc04ccfc74 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-9.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-9.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include <stdlib.h> @@ -77,4 +77,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */ /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/c90-longlong-1.c b/gcc/testsuite/gcc.dg/c90-longlong-1.c index e91e39e8014..3594d4be997 100644 --- a/gcc/testsuite/gcc.dg/c90-longlong-1.c +++ b/gcc/testsuite/gcc.dg/c90-longlong-1.c @@ -3,5 +3,4 @@ /* { dg-do compile } */ /* { dg-options "-std=iso9899:1990 -pedantic-errors" } */ -long long foo; /* { dg-bogus "warning" "warning in place of error" } */ -/* { dg-error "long long" "long long not in C90" { target *-*-* } 6 } */ +long long foo; /* { dg-error "long long" "long long not in C90" } */ diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-14.c b/gcc/testsuite/gcc.dg/c99-const-expr-14.c new file mode 100644 index 00000000000..0c4f1b69bd4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c99-const-expr-14.c @@ -0,0 +1,35 @@ +/* Test for constant expressions: cases involving VLAs, at file scope. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ + +/* It appears address constants may contain casts to variably modified + types. Whether they should be permitted was discussed in + <http://groups.google.com/group/comp.std.c/msg/923eee5ab690fd98> + <LV7g2Vy3ARF$Ew9Q@romana.davros.org>; since static pointers to VLAs + are definitely permitted within functions and may be initialized + and such initialization involves implicit conversion to a variably + modified type, allowing explicit casts seems appropriate. Thus, + GCC allows them as long as the "evaluated" size expressions do not + contain the various operators not permitted to be evaluated in a + constant expression, and as long as the result is genuinely + constant (meaning that pointer arithmetic using the size of the VLA + is generally not permitted). */ + +static int sa[100]; + +volatile int nv; +int m; +int n; +int f (int, int); + +static int (*a2)[] = (int (*)[n])sa; +static int (*a8)[] = (int (*)[(m=n)])sa; /* { dg-error "constant" } */ +static int (*a9)[] = (int (*)[(m+=n)])sa; /* { dg-error "constant" } */ +static int (*a10)[] = (int (*)[f(m,n)])sa; /* { dg-error "constant" } */ +static int (*a11)[] = (int (*)[(m,n)])sa; /* { dg-error "constant" } */ +static int (*a12)[] = (int (*)[sizeof(int[n])])sa; +static int (*a13)[] = (int (*)[sizeof(int[m++])])sa; /* { dg-error "constant" } */ +static int (*a15)[] = (int (*)[sizeof(*(int (*)[n])sa)])sa; +static int (*a16)[] = (int (*)[sizeof(*(int (*)[m++])sa)])sa; /* { dg-error "constant" } */ +static int (*a17)[] = (int (*)[nv])sa; diff --git a/gcc/testsuite/gcc.dg/c99-flex-array-7.c b/gcc/testsuite/gcc.dg/c99-flex-array-7.c new file mode 100644 index 00000000000..8966e6cccc0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c99-flex-array-7.c @@ -0,0 +1,17 @@ +/* Initialization of a flexible array member with a string constant + must be diagnosed. PR 37481. */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ + +struct s { int a; char b[]; }; + +struct s a = { 0, "" }; /* { dg-error "initialization of a flexible array member" } */ +/* { dg-error "near init" "near init" { target *-*-* } 8 } */ +struct s b = { 0, { 0 } }; /* { dg-error "initialization of a flexible array member" } */ +/* { dg-error "near init" "near init" { target *-*-* } 10 } */ +struct s c = { 0, { } }; /* { dg-error "ISO C forbids empty initializer braces" } */ +struct s d = { .b = "" }; /* { dg-error "initialization of a flexible array member" } */ +/* { dg-error "near init" "near init" { target *-*-* } 13 } */ +struct s e = { .b = { 0 } }; /* { dg-error "initialization of a flexible array member" } */ +/* { dg-error "near init" "near init" { target *-*-* } 15 } */ +struct s f = { .b = { } }; /* { dg-error "ISO C forbids empty initializer braces" } */ diff --git a/gcc/testsuite/gcc.dg/c99-intconst-2.c b/gcc/testsuite/gcc.dg/c99-intconst-2.c new file mode 100644 index 00000000000..34923675762 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c99-intconst-2.c @@ -0,0 +1,8 @@ +/* Test for integer constant types: diagnostics for constants outside + range of intmax_t must be pedwarns. PR 39559. */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ + +#if 9223372036854775808LL /* { dg-error "integer constant is so large that it is unsigned" } */ +unsigned long long l = 9223372036854775808LL; /* { dg-error "integer constant is so large that it is unsigned" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/c99-longlong-2.c b/gcc/testsuite/gcc.dg/c99-longlong-2.c new file mode 100644 index 00000000000..fc6c8a5efd0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c99-longlong-2.c @@ -0,0 +1,6 @@ +/* Test for long long: if explicit Wlong-long, in C99 only warn, not + pedwarn. */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -pedantic-errors -Wlong-long" } */ + +long long foo; /* { dg-warning "long long" } */ diff --git a/gcc/testsuite/gcc.dg/c99-restrict-3.c b/gcc/testsuite/gcc.dg/c99-restrict-3.c new file mode 100644 index 00000000000..e5200a57be9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c99-restrict-3.c @@ -0,0 +1,7 @@ +/* restrict qualifiers on non-pointers must be diagnosed even when + only a tag is being declared. PR 38243. */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ + +restrict struct s; /* { dg-error "restrict" } */ +restrict union u; /* { dg-error "restrict" } */ diff --git a/gcc/testsuite/gcc.dg/c99-stdint-1.c b/gcc/testsuite/gcc.dg/c99-stdint-1.c index 5dcac41276e..109aed4d284 100644 --- a/gcc/testsuite/gcc.dg/c99-stdint-1.c +++ b/gcc/testsuite/gcc.dg/c99-stdint-1.c @@ -89,19 +89,19 @@ test_exact (void) CHECK_WIDTH_EQUALS(int16_t, 16); CHECK_SIGNED_LIMITS(int16_t, INT16_MIN, INT16_MAX); #else - CHECK_WIDTH_AT_LEAST(int_least8_t, 17); + CHECK_WIDTH_AT_LEAST(int_least16_t, 17); #endif #ifdef INT32_MIN CHECK_WIDTH_EQUALS(int32_t, 32); CHECK_SIGNED_LIMITS(int32_t, INT32_MIN, INT32_MAX); #else - CHECK_WIDTH_AT_LEAST(int_least8_t, 33); + CHECK_WIDTH_AT_LEAST(int_least32_t, 33); #endif #ifdef INT64_MIN CHECK_WIDTH_EQUALS(int64_t, 64); CHECK_SIGNED_LIMITS(int64_t, INT64_MIN, INT64_MAX); #else - CHECK_WIDTH_AT_LEAST(int_least8_t, 65); + CHECK_WIDTH_AT_LEAST(int_least64_t, 65); #endif #ifdef UINT8_MAX CHECK_WIDTH_EQUALS(uint8_t, 8); @@ -113,19 +113,19 @@ test_exact (void) CHECK_WIDTH_EQUALS(uint16_t, 16); CHECK_UNSIGNED_LIMITS(uint16_t, UINT16_MAX); #else - CHECK_WIDTH_AT_LEAST(uint_least8_t, 17); + CHECK_WIDTH_AT_LEAST(uint_least16_t, 17); #endif #ifdef UINT32_MAX CHECK_WIDTH_EQUALS(uint32_t, 32); CHECK_UNSIGNED_LIMITS(uint32_t, UINT32_MAX); #else - CHECK_WIDTH_AT_LEAST(uint_least8_t, 33); + CHECK_WIDTH_AT_LEAST(uint_least32_t, 33); #endif #ifdef UINT64_MAX CHECK_WIDTH_EQUALS(uint64_t, 64); CHECK_UNSIGNED_LIMITS(uint64_t, UINT64_MAX); #else - CHECK_WIDTH_AT_LEAST(uint_least8_t, 65); + CHECK_WIDTH_AT_LEAST(uint_least64_t, 65); #endif } diff --git a/gcc/testsuite/gcc.dg/c99-stdint-7.c b/gcc/testsuite/gcc.dg/c99-stdint-7.c new file mode 100644 index 00000000000..777e895b506 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c99-stdint-7.c @@ -0,0 +1,217 @@ +/* Verify that the limits defined in <stdint.h> are those GCC expects + internally to be defined and that they are usable in #if + conditions. */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -fhosted" } */ + +#include <stdint.h> + +/* Exact-width and pointer-holding types are optional. */ +#if defined(INT8_MIN) != defined(__INT8_TYPE__) +#error "Unexpected INT8_MIN definedness" +#endif +#if defined(INT8_MAX) != defined(__INT8_TYPE__) +#error "Unexpected INT8_MAX definedness" +#endif +#if defined(UINT8_MAX) != defined(__UINT8_TYPE__) +#error "Unexpected UINT8_MAX definedness" +#endif +#if defined(INT16_MIN) != defined(__INT16_TYPE__) +#error "Unexpected INT16_MIN definedness" +#endif +#if defined(INT16_MAX) != defined(__INT16_TYPE__) +#error "Unexpected INT16_MAX definedness" +#endif +#if defined(UINT16_MAX) != defined(__UINT16_TYPE__) +#error "Unexpected UINT16_MAX definedness" +#endif +#if defined(INT32_MIN) != defined(__INT32_TYPE__) +#error "Unexpected INT32_MIN definedness" +#endif +#if defined(INT32_MAX) != defined(__INT32_TYPE__) +#error "Unexpected INT32_MAX definedness" +#endif +#if defined(UINT32_MAX) != defined(__UINT32_TYPE__) +#error "Unexpected UINT32_MAX definedness" +#endif +#if defined(INT64_MIN) != defined(__INT64_TYPE__) +#error "Unexpected INT64_MIN definedness" +#endif +#if defined(INT64_MAX) != defined(__INT64_TYPE__) +#error "Unexpected INT64_MAX definedness" +#endif +#if defined(UINT64_MAX) != defined(__UINT64_TYPE__) +#error "Unexpected UINT64_MAX definedness" +#endif +#if defined(INTPTR_MIN) != defined(__INTPTR_TYPE__) +#error "Unexpected INTPTR_MIN definedness" +#endif +#if defined(INTPTR_MAX) != defined(__INTPTR_TYPE__) +#error "Unexpected INTPTR_MAX definedness" +#endif +#if defined(UINTPTR_MAX) != defined(__UINTPTR_TYPE__) +#error "Unexpected UINTPTR_MAX definedness" +#endif + +#if defined(INT8_MIN) && INT8_MIN != -__INT8_MAX__-1 +#error "INT8_MIN not usable in #if or wrong value" +#endif +#if defined(INT8_MAX) && INT8_MAX != __INT8_MAX__ +#error "INT8_MAX not usable in #if or wrong value" +#endif +#if defined(UINT8_MAX) && UINT8_MAX != __UINT8_MAX__ +#error "UINT8_MAX not usable in #if or wrong value" +#endif +#if defined(INT16_MIN) && INT16_MIN != -__INT16_MAX__-1 +#error "INT16_MIN not usable in #if or wrong value" +#endif +#if defined(INT16_MAX) && INT16_MAX != __INT16_MAX__ +#error "INT16_MAX not usable in #if or wrong value" +#endif +#if defined(UINT16_MAX) && UINT16_MAX != __UINT16_MAX__ +#error "UINT16_MAX not usable in #if or wrong value" +#endif +#if defined(INT32_MIN) && INT32_MIN != -__INT32_MAX__-1 +#error "INT32_MIN not usable in #if or wrong value" +#endif +#if defined(INT32_MAX) && INT32_MAX != __INT32_MAX__ +#error "INT32_MAX not usable in #if or wrong value" +#endif +#if defined(UINT32_MAX) && UINT32_MAX != __UINT32_MAX__ +#error "UINT32_MAX not usable in #if or wrong value" +#endif +#if defined(INT64_MIN) && INT64_MIN != -__INT64_MAX__-1 +#error "INT64_MIN not usable in #if or wrong value" +#endif +#if defined(INT64_MAX) && INT64_MAX != __INT64_MAX__ +#error "INT64_MAX not usable in #if or wrong value" +#endif +#if defined(UINT64_MAX) && UINT64_MAX != __UINT64_MAX__ +#error "UINT64_MAX not usable in #if or wrong value" +#endif + +#if INT_LEAST8_MIN != -__INT_LEAST8_MAX__-1 +#error "INT_LEAST8_MIN not usable in #if or wrong value" +#endif +#if INT_LEAST8_MAX != __INT_LEAST8_MAX__ +#error "INT_LEAST8_MAX not usable in #if or wrong value" +#endif +#if UINT_LEAST8_MAX != __UINT_LEAST8_MAX__ +#error "UINT_LEAST8_MAX not usable in #if or wrong value" +#endif +#if INT_LEAST16_MIN != -__INT_LEAST16_MAX__-1 +#error "INT_LEAST16_MIN not usable in #if or wrong value" +#endif +#if INT_LEAST16_MAX != __INT_LEAST16_MAX__ +#error "INT_LEAST16_MAX not usable in #if or wrong value" +#endif +#if UINT_LEAST16_MAX != __UINT_LEAST16_MAX__ +#error "UINT_LEAST16_MAX not usable in #if or wrong value" +#endif +#if INT_LEAST32_MIN != -__INT_LEAST32_MAX__-1 +#error "INT_LEAST32_MIN not usable in #if or wrong value" +#endif +#if INT_LEAST32_MAX != __INT_LEAST32_MAX__ +#error "INT_LEAST32_MAX not usable in #if or wrong value" +#endif +#if UINT_LEAST32_MAX != __UINT_LEAST32_MAX__ +#error "UINT_LEAST32_MAX not usable in #if or wrong value" +#endif +#if INT_LEAST64_MIN != -__INT_LEAST64_MAX__-1 +#error "INT_LEAST64_MIN not usable in #if or wrong value" +#endif +#if INT_LEAST64_MAX != __INT_LEAST64_MAX__ +#error "INT_LEAST64_MAX not usable in #if or wrong value" +#endif +#if UINT_LEAST64_MAX != __UINT_LEAST64_MAX__ +#error "UINT_LEAST64_MAX not usable in #if or wrong value" +#endif + +#if INT_FAST8_MIN != -__INT_FAST8_MAX__-1 +#error "INT_FAST8_MIN not usable in #if or wrong value" +#endif +#if INT_FAST8_MAX != __INT_FAST8_MAX__ +#error "INT_FAST8_MAX not usable in #if or wrong value" +#endif +#if UINT_FAST8_MAX != __UINT_FAST8_MAX__ +#error "UINT_FAST8_MAX not usable in #if or wrong value" +#endif +#if INT_FAST16_MIN != -__INT_FAST16_MAX__-1 +#error "INT_FAST16_MIN not usable in #if or wrong value" +#endif +#if INT_FAST16_MAX != __INT_FAST16_MAX__ +#error "INT_FAST16_MAX not usable in #if or wrong value" +#endif +#if UINT_FAST16_MAX != __UINT_FAST16_MAX__ +#error "UINT_FAST16_MAX not usable in #if or wrong value" +#endif +#if INT_FAST32_MIN != -__INT_FAST32_MAX__-1 +#error "INT_FAST32_MIN not usable in #if or wrong value" +#endif +#if INT_FAST32_MAX != __INT_FAST32_MAX__ +#error "INT_FAST32_MAX not usable in #if or wrong value" +#endif +#if UINT_FAST32_MAX != __UINT_FAST32_MAX__ +#error "UINT_FAST32_MAX not usable in #if or wrong value" +#endif +#if INT_FAST64_MIN != -__INT_FAST64_MAX__-1 +#error "INT_FAST64_MIN not usable in #if or wrong value" +#endif +#if INT_FAST64_MAX != __INT_FAST64_MAX__ +#error "INT_FAST64_MAX not usable in #if or wrong value" +#endif +#if UINT_FAST64_MAX != __UINT_FAST64_MAX__ +#error "UINT_FAST64_MAX not usable in #if or wrong value" +#endif + +#if defined(INTPTR_MIN) && INTPTR_MIN != -__INTPTR_MAX__-1 +#error "INTPTR_MIN not usable in #if or wrong value" +#endif +#if defined(INTPTR_MAX) && INTPTR_MAX != __INTPTR_MAX__ +#error "INTPTR_MAX not usable in #if or wrong value" +#endif +#if defined(UINTPTR_MAX) && UINTPTR_MAX != __UINTPTR_MAX__ +#error "UINTPTR_MAX not usable in #if or wrong value" +#endif + +#if INTMAX_MIN != -__INTMAX_MAX__-1 +#error "INTMAX_MIN not usable in #if or wrong value" +#endif +#if INTMAX_MAX != __INTMAX_MAX__ +#error "INTMAX_MAX not usable in #if or wrong value" +#endif +#if UINTMAX_MAX != __UINTMAX_MAX__ +#error "UINTMAX_MAX not usable in #if or wrong value" +#endif + +#if PTRDIFF_MIN != -__PTRDIFF_MAX__-1 +#error "PTRDIFF_MIN not usable in #if or wrong value" +#endif +#if PTRDIFF_MAX != __PTRDIFF_MAX__ +#error "PTRDIFF_MAX not usable in #if or wrong value" +#endif + +#if SIG_ATOMIC_MIN != __SIG_ATOMIC_MIN__ +#error "SIG_ATOMIC_MIN not usable in #if or wrong value" +#endif +#if SIG_ATOMIC_MAX != __SIG_ATOMIC_MAX__ +#error "SIG_ATOMIC_MAX not usable in #if or wrong value" +#endif + +#if SIZE_MAX != __SIZE_MAX__ +#error "SIZE_MAX not usable in #if or wrong value" +#endif + +#if WCHAR_MIN != __WCHAR_MIN__ +#error "WCHAR_MIN not usable in #if or wrong value" +#endif +#if WCHAR_MAX != __WCHAR_MAX__ +#error "WCHAR_MAX not usable in #if or wrong value" +#endif + +#if WINT_MIN != __WINT_MIN__ +#error "WINT_MIN not usable in #if or wrong value" +#endif +#if WINT_MAX != __WINT_MAX__ +#error "WINT_MAX not usable in #if or wrong value" +#endif diff --git a/gcc/testsuite/gcc.dg/c99-stdint-8.c b/gcc/testsuite/gcc.dg/c99-stdint-8.c new file mode 100644 index 00000000000..c64b3feb4f6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c99-stdint-8.c @@ -0,0 +1,9 @@ +/* Verify that the limits defined in <stdint.h> are those GCC expects + internally to be defined and that they are usable in #if + conditions. Freestanding version. */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -ffreestanding" } */ + +/* The test is that there are no diagnostics, so just include the + hosted version. */ +#include "c99-stdint-7.c" diff --git a/gcc/testsuite/gcc.dg/call-diag-2.c b/gcc/testsuite/gcc.dg/call-diag-2.c new file mode 100644 index 00000000000..0d87e52e973 --- /dev/null +++ b/gcc/testsuite/gcc.dg/call-diag-2.c @@ -0,0 +1,17 @@ +/* Test diagnostics for calling function returning qualified void or + other incomplete type other than void. PR 35210. */ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ + +const void f_cv (void); +struct s f_s (void); +void f_v (void); + +void g1 (void) { f_cv (); } /* { dg-error "qualified void" } */ +void g2 (void) { f_s (); } /* { dg-error "invalid use of undefined type" } */ +void g3 (void) { ((const void (*) (void)) f_v) (); } /* { dg-error "qualified void" } */ +/* { dg-warning "function called through a non-compatible type" "cast" { target *-*-* } 12 } */ +/* { dg-message "will abort" "abort" { target *-*-* } 12 } */ +void g4 (void) { ((struct s (*) (void)) f_v) (), (void) 0; } /* { dg-error "invalid use of undefined type" } */ +/* { dg-warning "function called through a non-compatible type" "cast" { target *-*-* } 15 } */ +/* { dg-message "will abort" "abort" { target *-*-* } 15 } */ diff --git a/gcc/testsuite/gcc.dg/case-const-1.c b/gcc/testsuite/gcc.dg/case-const-1.c new file mode 100644 index 00000000000..ba39d09616b --- /dev/null +++ b/gcc/testsuite/gcc.dg/case-const-1.c @@ -0,0 +1,15 @@ +/* Test for case labels not integer constant expressions but folding + to integer constants (used in Linux kernel, PR 39613). */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +extern int i; +void +f (int c) +{ + switch (c) + { + case (1 ? 1 : i): + ; + } +} diff --git a/gcc/testsuite/gcc.dg/case-const-2.c b/gcc/testsuite/gcc.dg/case-const-2.c new file mode 100644 index 00000000000..9c119b04df5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/case-const-2.c @@ -0,0 +1,15 @@ +/* Test for case labels not integer constant expressions but folding + to integer constants (used in Linux kernel, PR 39613). */ +/* { dg-do compile } */ +/* { dg-options "-pedantic" } */ + +extern int i; +void +f (int c) +{ + switch (c) + { + case (1 ? 1 : i): /* { dg-warning "case label is not an integer constant expression" } */ + ; + } +} diff --git a/gcc/testsuite/gcc.dg/case-const-3.c b/gcc/testsuite/gcc.dg/case-const-3.c new file mode 100644 index 00000000000..7224cca47d7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/case-const-3.c @@ -0,0 +1,15 @@ +/* Test for case labels not integer constant expressions but folding + to integer constants (used in Linux kernel, PR 39613). */ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ + +extern int i; +void +f (int c) +{ + switch (c) + { + case (1 ? 1 : i): /* { dg-error "case label is not an integer constant expression" } */ + ; + } +} diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c b/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c index c77ba33580f..0c672394870 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c +++ b/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c @@ -1,4 +1,5 @@ -/* { dg-options "-O" } */ +/* { dg-options "-O -Wno-psabi" } */ + #ifdef __x86_64__ #include "struct-complex-1.h" diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-1_y.c b/gcc/testsuite/gcc.dg/compat/struct-complex-1_y.c index 9ff450f796c..858e6a9da8b 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-complex-1_y.c +++ b/gcc/testsuite/gcc.dg/compat/struct-complex-1_y.c @@ -1,4 +1,4 @@ -/* { dg-options "-O" } */ +/* { dg-options "-O -Wno-psabi" } */ #ifdef __x86_64__ #include <stdlib.h> diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-2.h b/gcc/testsuite/gcc.dg/compat/struct-complex-2.h new file mode 100644 index 00000000000..1fd1e86c2ba --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-complex-2.h @@ -0,0 +1,15 @@ +#include <complex.h> + +struct st +{ + int s1; + float complex x; +}; + +typedef struct { float r, i; } _complex; + +struct stc +{ + int s1; + _complex x; +}; diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-2_main.c b/gcc/testsuite/gcc.dg/compat/struct-complex-2_main.c new file mode 100644 index 00000000000..74eae62423b --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-complex-2_main.c @@ -0,0 +1,21 @@ +/* { dg-options "-O" } */ + +#ifdef __x86_64__ +/* Test function argument passing. PR target/39678. */ + +extern void struct_complex_2_x (void); +extern void exit (int); + +int +main () +{ + struct_complex_2_x (); + exit (0); +} +#else +int +main () +{ + return 0; +} +#endif diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c b/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c new file mode 100644 index 00000000000..2fb9826eb0f --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c @@ -0,0 +1,30 @@ +/* { dg-options "-O -Wno-psabi" } */ + + +#ifdef __x86_64__ +#include "struct-complex-2.h" + +struct st st1; +struct stc st2; + +extern void foo (); +extern void bar (); + +int +struct_complex_2_x () +{ + st1.s1 = 1; + __real__ st1.x = 2; + __imag__ st1.x = 4; + st2.s1 = 1; + st2.x.r = 2; + st2.x.i = 4; + foo (st1); + foo (st2); + bar (st1); + bar (st2); + return 0; +} +#else +int dummy_x; +#endif diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-2_y.c b/gcc/testsuite/gcc.dg/compat/struct-complex-2_y.c new file mode 100644 index 00000000000..54a72fa43f3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-complex-2_y.c @@ -0,0 +1,23 @@ +/* { dg-options "-O -Wno-psabi" } */ + +#ifdef __x86_64__ +#include <stdlib.h> +#include "struct-complex-2.h" + +void +bar(struct st x) +{ + if (x.s1 != 1 + || __real__ x.x != 2 || __imag__ x.x != 4) + abort (); +} + +void +foo(struct stc x) +{ + if (x.s1 != 1 || x.x.r != 2 || x.x.i != 4) + abort (); +} +#else +int dummy_y; +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/include5.c b/gcc/testsuite/gcc.dg/cpp/include5.c new file mode 100644 index 00000000000..9bbc2878d05 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/include5.c @@ -0,0 +1,9 @@ +/* Test #include directives with macros expanding to empty. */ + +#define EMPTY_OBJ +#define EMPTY_FUNC() + +#include <stddef.h> EMPTY_OBJ +#include <stddef.h> EMPTY_FUNC() +#include "stddef.h" EMPTY_OBJ +#include "stddef.h" EMPTY_FUNC() diff --git a/gcc/testsuite/gcc.dg/cpp/line7.c b/gcc/testsuite/gcc.dg/cpp/line7.c new file mode 100644 index 00000000000..754727e885f --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/line7.c @@ -0,0 +1,19 @@ +/* Test #line syntax, including macro expansion and empty macros. PR + 39647. */ + +/* { dg-do preprocess } */ +/* { dg-options "-std=c99 -pedantic-errors" } */ + +#define EMPTY_OBJ +#define EMPTY_FUNC() + +#define A 12 "line7.c" +#line A + +#line EMPTY_OBJ /* { dg-error "unexpected end of file" } */ +#line X /* { dg-error "is not a positive integer" } */ +#line 16 16 /* { dg-error "is not a valid filename" } */ + +#line 18 "line7.c" EMPTY_OBJ +#line 19 "line7.c" EMPTY_FUNC() +#line 20 "line7.c" foo /* { dg-error "extra tokens at end" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/line8.c b/gcc/testsuite/gcc.dg/cpp/line8.c new file mode 100644 index 00000000000..5aeb26ca325 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/line8.c @@ -0,0 +1,10 @@ +/* Test that "" is not specially interpreted as "<stdin>" in a #line + directive. PR 39646. */ + +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ + +extern int x; + +#line 24 "" +extern char z[sizeof __FILE__ == 1]; diff --git a/gcc/testsuite/gcc.dg/cpp/paste16.c b/gcc/testsuite/gcc.dg/cpp/paste16.c new file mode 100644 index 00000000000..11aca2b60d4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/paste16.c @@ -0,0 +1,6 @@ +/* Test multiple consecutive ## tokens. */ +/* { dg-do compile } */ +/* { dg-options "" } */ +#define cat(x,y) x##########y +int abcd; +int *p = &cat(ab,cd); diff --git a/gcc/testsuite/gcc.dg/cpp/redef4.c b/gcc/testsuite/gcc.dg/cpp/redef4.c new file mode 100644 index 00000000000..b34635b2e42 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/redef4.c @@ -0,0 +1,499 @@ +/* Test redefinitions differing only in the spelling of paste and + stringify tokens, whitespace around them, or the number of + consecutive paste tokens. */ +/* { dg-do preprocess } */ +/* { dg-options "" } */ + +#define str(x) #x /* { dg-message "previous definition" } */ +#define str(x) %: x /* { dg-warning "redefined" } */ +#undef str +#define str(x) #x /* { dg-message "previous definition" } */ +#define str(x) # x /* { dg-warning "redefined" } */ +#undef str +#define str(x) #x /* { dg-message "previous definition" } */ +#define str(x) %: x /* { dg-warning "redefined" } */ +#undef str +#define str(x) %:x /* { dg-message "previous definition" } */ +#define str(x) #x /* { dg-warning "redefined" } */ +#undef str +#define str(x) %:x /* { dg-message "previous definition" } */ +#define str(x) %: x /* { dg-warning "redefined" } */ +#undef str +#define str(x) %:x /* { dg-message "previous definition" } */ +#define str(x) # x /* { dg-warning "redefined" } */ +#undef str +#define str(x) %:x /* { dg-message "previous definition" } */ +#define str(x) %: x /* { dg-warning "redefined" } */ +#undef str +#define str(x) # x /* { dg-message "previous definition" } */ +#define str(x) #x /* { dg-warning "redefined" } */ +#undef str +#define str(x) # x /* { dg-message "previous definition" } */ +#define str(x) %: x /* { dg-warning "redefined" } */ +#undef str +#define str(x) # x /* { dg-message "previous definition" } */ +#define str(x) %: x /* { dg-warning "redefined" } */ +#undef str +#define str(x) %: x /* { dg-message "previous definition" } */ +#define str(x) #x /* { dg-warning "redefined" } */ +#undef str +#define str(x) %: x /* { dg-message "previous definition" } */ +#define str(x) # x /* { dg-warning "redefined" } */ +#undef str + +#define str(x) #x +#define str(x) #x +#undef str +#define str(x) # x +#define str(x) # x +#undef str +#define str(x) %: x +#define str(x) %: x +#undef str +#define str(x) %: x +#define str(x) %: x +#undef str + +#define astr(x) a#x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a#x /* { dg-message "previous definition" } */ +#define astr(x) a# x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a#x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a#x /* { dg-message "previous definition" } */ +#define astr(x) a #x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a#x /* { dg-message "previous definition" } */ +#define astr(x) a %:x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a#x /* { dg-message "previous definition" } */ +#define astr(x) a # x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a#x /* { dg-message "previous definition" } */ +#define astr(x) a %: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%:x /* { dg-message "previous definition" } */ +#define astr(x) a#x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%:x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%:x /* { dg-message "previous definition" } */ +#define astr(x) a# x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%:x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%:x /* { dg-message "previous definition" } */ +#define astr(x) a #x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%:x /* { dg-message "previous definition" } */ +#define astr(x) a %:x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%:x /* { dg-message "previous definition" } */ +#define astr(x) a # x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%:x /* { dg-message "previous definition" } */ +#define astr(x) a %: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a# x /* { dg-message "previous definition" } */ +#define astr(x) a#x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a# x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a# x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a# x /* { dg-message "previous definition" } */ +#define astr(x) a #x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a# x /* { dg-message "previous definition" } */ +#define astr(x) a %:x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a# x /* { dg-message "previous definition" } */ +#define astr(x) a # x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a# x /* { dg-message "previous definition" } */ +#define astr(x) a %: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%: x /* { dg-message "previous definition" } */ +#define astr(x) a#x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%: x /* { dg-message "previous definition" } */ +#define astr(x) a# x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%: x /* { dg-message "previous definition" } */ +#define astr(x) a #x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%: x /* { dg-message "previous definition" } */ +#define astr(x) a %:x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%: x /* { dg-message "previous definition" } */ +#define astr(x) a # x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a%: x /* { dg-message "previous definition" } */ +#define astr(x) a %: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a #x /* { dg-message "previous definition" } */ +#define astr(x) a#x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a #x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a #x /* { dg-message "previous definition" } */ +#define astr(x) a# x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a #x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a #x /* { dg-message "previous definition" } */ +#define astr(x) a %:x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a #x /* { dg-message "previous definition" } */ +#define astr(x) a # x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a #x /* { dg-message "previous definition" } */ +#define astr(x) a %: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %:x /* { dg-message "previous definition" } */ +#define astr(x) a#x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %:x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %:x /* { dg-message "previous definition" } */ +#define astr(x) a# x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %:x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %:x /* { dg-message "previous definition" } */ +#define astr(x) a #x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %:x /* { dg-message "previous definition" } */ +#define astr(x) a # x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %:x /* { dg-message "previous definition" } */ +#define astr(x) a %: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a # x /* { dg-message "previous definition" } */ +#define astr(x) a#x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a # x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a # x /* { dg-message "previous definition" } */ +#define astr(x) a# x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a # x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a # x /* { dg-message "previous definition" } */ +#define astr(x) a #x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a # x /* { dg-message "previous definition" } */ +#define astr(x) a %:x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a # x /* { dg-message "previous definition" } */ +#define astr(x) a %: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %: x /* { dg-message "previous definition" } */ +#define astr(x) a#x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %: x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %: x /* { dg-message "previous definition" } */ +#define astr(x) a# x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %: x /* { dg-message "previous definition" } */ +#define astr(x) a%: x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %: x /* { dg-message "previous definition" } */ +#define astr(x) a #x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %: x /* { dg-message "previous definition" } */ +#define astr(x) a %:x /* { dg-warning "redefined" } */ +#undef astr +#define astr(x) a %: x /* { dg-message "previous definition" } */ +#define astr(x) a # x /* { dg-warning "redefined" } */ +#undef astr + +#define astr(x) a#x +#define astr(x) a#x +#undef astr +#define astr(x) a# x +#define astr(x) a# x +#undef astr +#define astr(x) a%: x +#define astr(x) a%: x +#undef astr +#define astr(x) a%: x +#define astr(x) a%: x +#undef astr +#define astr(x) a #x +#define astr(x) a #x +#undef astr +#define astr(x) a %:x +#define astr(x) a %:x +#undef astr +#define astr(x) a # x +#define astr(x) a # x +#undef astr +#define astr(x) a %: x +#define astr(x) a %: x +#undef astr + +#define cat(x,y) x##y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x##y /* { dg-message "previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x##y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x##y /* { dg-message "previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x##y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x##y /* { dg-message "previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x##y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x## y /* { dg-message "previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x## y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x## y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x## y /* { dg-message "previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x## y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x## y /* { dg-message "previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x## y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ##y /* { dg-message "previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ##y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ##y /* { dg-message "previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ##y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ##y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ##y /* { dg-message "previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ##y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ## y /* { dg-message "previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ## y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ## y /* { dg-message "previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ## y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ## y /* { dg-message "previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ## y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x ## y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#undef cat +#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#undef cat + +#define cat(x,y) x##y +#define cat(x,y) x##y +#undef cat +#define cat(x,y) x## y +#define cat(x,y) x## y +#undef cat +#define cat(x,y) x%:%: y +#define cat(x,y) x%:%: y +#undef cat +#define cat(x,y) x%:%: y +#define cat(x,y) x%:%: y +#undef cat +#define cat(x,y) x ##y +#define cat(x,y) x ##y +#undef cat +#define cat(x,y) x %:%:y +#define cat(x,y) x %:%:y +#undef cat +#define cat(x,y) x ## y +#define cat(x,y) x ## y +#undef cat +#define cat(x,y) x %:%: y +#define cat(x,y) x %:%: y +#undef cat + +#define cat3(x,y,z) x##y##z /* { dg-message "previous definition" } */ +#define cat3(x,y,z) x##y####z /* { dg-warning "redefined" } */ +#undef cat3 + +#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */ +#define cat3(x,y,z) x####y##z /* { dg-warning "redefined" } */ +#undef cat3 + +#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */ +#define cat3(x,y,z) x##y## ##z /* { dg-warning "redefined" } */ +#undef cat3 + +#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */ +#define cat3(x,y,z) x##y##%:%:z /* { dg-warning "redefined" } */ +#undef cat3 + +#define cat3(x,y,z) x##y######## ####z /* { dg-message "previous definition" } */ +#define cat3(x,y,z) x##y############z /* { dg-warning "redefined" } */ +#undef cat3 + +#define cat3(x,y,z) x##y############z /* { dg-message "previous definition" } */ +#define cat3(x,y,z) x##y########%:%:##z /* { dg-warning "redefined" } */ +#undef cat3 + +#define cat3(x,y,z) x##y##z +#define cat3(x,y,z) x##y##z +#undef cat3 + +#define cat3(x,y,z) x##y####z +#define cat3(x,y,z) x##y####z +#undef cat3 + +#define cat3(x,y,z) x####y##z +#define cat3(x,y,z) x####y##z +#undef cat3 + +#define cat3(x,y,z) x##y## ##z +#define cat3(x,y,z) x##y## ##z +#undef cat3 + +#define cat3(x,y,z) x##y##%:%:z +#define cat3(x,y,z) x##y##%:%:z +#undef cat3 + +#define cat3(x,y,z) x##y######## ####z +#define cat3(x,y,z) x##y######## ####z +#undef cat3 + +#define cat3(x,y,z) x##y############z +#define cat3(x,y,z) x##y############z +#undef cat3 + +#define cat3(x,y,z) x##y########%:%:##z +#define cat3(x,y,z) x##y########%:%:##z +#undef cat3 diff --git a/gcc/testsuite/gcc.dg/cpp/strify5.c b/gcc/testsuite/gcc.dg/cpp/strify5.c new file mode 100644 index 00000000000..f564682819b --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/strify5.c @@ -0,0 +1,1260 @@ +/* Test handling of spaces and empty macro expansions in + stringifying. PR 31869. */ +/* { dg-do run } */ + +extern int strcmp (const char *, const char *); +extern int puts (const char *); +extern void abort (void); +extern void exit (int); +#define err(str) do { puts (str); abort (); } while (0) + +#define s(x) #x +#define v(x, r) if (strcmp (s(x), r)) err (#x) + +#define EOA /* empty */ +#define EFA() /* empty */ +#define EOB EFA()EFA() +#define EOC EFA()EOA +#define EFB() EFA()EFA() +#define EFC() EFA()EOA +#define ARG(x) x +#define SOA EOA EOA +#define SOB ARG(EFB() EOA) +#define SOC ARG(SOA) +#define SFA() EOA EOA +#define SFB() ARG(EFB() EOA) +#define SFC() ARG(SOA) +#define SAa(x) x EOA +#define SAb(x) x EOB +#define SAc(x) x EOC +#define SAd(x) x EFA() +#define SAe(x) x EFB() +#define SAf(x) x EFC() +#define SBa(x) EOA x +#define SBb(x) EOB x +#define SBc(x) EOC x +#define SBd(x) SFA()x +#define SBe(x) SFB()x +#define SBf(x) SFC()x + +void +check0 (void) +{ + v(||, "||"); + v(|EOA|, "||"); + v(|EOB|, "||"); + v(|EOC|, "||"); + v(|EFA()|, "||"); + v(|EFB()|, "||"); + v(|EFC()|, "||"); +} + +void +check1 (void) +{ + v(|SBa(|), "| |"); + v(|SBb(|), "| |"); + v(|SBc(|), "| |"); + v(|SBd(|), "| |"); + v(|SBe(|), "| |"); + v(|SBf(|), "| |"); + v(| |, "| |"); + v(| SBa(|), "| |"); + v(| SBb(|), "| |"); + v(| SBc(|), "| |"); + v(| SBd(|), "| |"); + v(| SBe(|), "| |"); + v(| SBf(|), "| |"); + v(|EFA()SBa(|), "| |"); + v(|EFA()SBb(|), "| |"); + v(|EFA()SBc(|), "| |"); + v(|EFA()SBd(|), "| |"); + v(|EFA()SBe(|), "| |"); + v(|EFA()SBf(|), "| |"); + v(|EFB()SBa(|), "| |"); + v(|EFB()SBb(|), "| |"); + v(|EFB()SBc(|), "| |"); + v(|EFB()SBd(|), "| |"); + v(|EFB()SBe(|), "| |"); + v(|EFB()SBf(|), "| |"); + v(|EFC()SBa(|), "| |"); + v(|EFC()SBb(|), "| |"); + v(|EFC()SBc(|), "| |"); + v(|EFC()SBd(|), "| |"); + v(|EFC()SBe(|), "| |"); + v(|EFC()SBf(|), "| |"); + v(| EOA|, "| |"); + v(| EOB|, "| |"); + v(| EOC|, "| |"); + v(| EFA()|, "| |"); + v(| EFA()SBa(|), "| |"); + v(| EFA()SBb(|), "| |"); + v(| EFA()SBc(|), "| |"); + v(| EFA()SBd(|), "| |"); + v(| EFA()SBe(|), "| |"); + v(| EFA()SBf(|), "| |"); + v(| EFB()|, "| |"); + v(| EFB()SBa(|), "| |"); + v(| EFB()SBb(|), "| |"); + v(| EFB()SBc(|), "| |"); + v(| EFB()SBd(|), "| |"); + v(| EFB()SBe(|), "| |"); + v(| EFB()SBf(|), "| |"); + v(| EFC()|, "| |"); + v(| EFC()SBa(|), "| |"); + v(| EFC()SBb(|), "| |"); + v(| EFC()SBc(|), "| |"); + v(| EFC()SBd(|), "| |"); + v(| EFC()SBe(|), "| |"); + v(| EFC()SBf(|), "| |"); + v(|EOA |, "| |"); + v(|EOA SBa(|), "| |"); + v(|EOA SBb(|), "| |"); + v(|EOA SBc(|), "| |"); + v(|EOA SBd(|), "| |"); + v(|EOA SBe(|), "| |"); + v(|EOA SBf(|), "| |"); + v(|EOB |, "| |"); + v(|EOB SBa(|), "| |"); + v(|EOB SBb(|), "| |"); + v(|EOB SBc(|), "| |"); + v(|EOB SBd(|), "| |"); + v(|EOB SBe(|), "| |"); + v(|EOB SBf(|), "| |"); + v(|EOC |, "| |"); + v(|EOC SBa(|), "| |"); + v(|EOC SBb(|), "| |"); + v(|EOC SBc(|), "| |"); + v(|EOC SBd(|), "| |"); + v(|EOC SBe(|), "| |"); + v(|EOC SBf(|), "| |"); + v(|EFA() |, "| |"); + v(|EFA() SBa(|), "| |"); + v(|EFA() SBb(|), "| |"); + v(|EFA() SBc(|), "| |"); + v(|EFA() SBd(|), "| |"); + v(|EFA() SBe(|), "| |"); + v(|EFA() SBf(|), "| |"); + v(|EFB() |, "| |"); + v(|EFB() SBa(|), "| |"); + v(|EFB() SBb(|), "| |"); + v(|EFB() SBc(|), "| |"); + v(|EFB() SBd(|), "| |"); + v(|EFB() SBe(|), "| |"); + v(|EFB() SBf(|), "| |"); + v(|EFC() |, "| |"); + v(|EFC() SBa(|), "| |"); + v(|EFC() SBb(|), "| |"); + v(|EFC() SBc(|), "| |"); + v(|EFC() SBd(|), "| |"); + v(|EFC() SBe(|), "| |"); + v(|EFC() SBf(|), "| |"); + v(| EOA |, "| |"); + v(| EOA SBa(|), "| |"); + v(| EOA SBb(|), "| |"); + v(| EOA SBc(|), "| |"); + v(| EOA SBd(|), "| |"); + v(| EOA SBe(|), "| |"); + v(| EOA SBf(|), "| |"); + v(| EOB |, "| |"); + v(| EOB SBa(|), "| |"); + v(| EOB SBb(|), "| |"); + v(| EOB SBc(|), "| |"); + v(| EOB SBd(|), "| |"); + v(| EOB SBe(|), "| |"); + v(| EOB SBf(|), "| |"); + v(| EOC |, "| |"); + v(| EOC SBa(|), "| |"); + v(| EOC SBb(|), "| |"); + v(| EOC SBc(|), "| |"); + v(| EOC SBd(|), "| |"); + v(| EOC SBe(|), "| |"); + v(| EOC SBf(|), "| |"); + v(| EFA() |, "| |"); + v(| EFA() SBa(|), "| |"); + v(| EFA() SBb(|), "| |"); + v(| EFA() SBc(|), "| |"); + v(| EFA() SBd(|), "| |"); + v(| EFA() SBe(|), "| |"); + v(| EFA() SBf(|), "| |"); + v(| EFB() |, "| |"); + v(| EFB() SBa(|), "| |"); + v(| EFB() SBb(|), "| |"); + v(| EFB() SBc(|), "| |"); + v(| EFB() SBd(|), "| |"); + v(| EFB() SBe(|), "| |"); + v(| EFB() SBf(|), "| |"); + v(| EFC() |, "| |"); + v(| EFC() SBa(|), "| |"); + v(| EFC() SBb(|), "| |"); + v(| EFC() SBc(|), "| |"); + v(| EFC() SBd(|), "| |"); + v(| EFC() SBe(|), "| |"); + v(| EFC() SBf(|), "| |"); +} + +void +check2 (void) +{ + v(SAa(|)|, "| |"); + v(SAa(|)SBa(|), "| |"); + v(SAa(|)SBb(|), "| |"); + v(SAa(|)SBc(|), "| |"); + v(SAa(|)SBd(|), "| |"); + v(SAa(|)SBe(|), "| |"); + v(SAa(|)SBf(|), "| |"); + v(SAa(|) |, "| |"); + v(SAa(|) SBa(|), "| |"); + v(SAa(|) SBb(|), "| |"); + v(SAa(|) SBc(|), "| |"); + v(SAa(|) SBd(|), "| |"); + v(SAa(|) SBe(|), "| |"); + v(SAa(|) SBf(|), "| |"); + v(SAa(|)EOA|, "| |"); + v(SAa(|)EOB|, "| |"); + v(SAa(|)EOC|, "| |"); + v(SAa(|)EFA()|, "| |"); + v(SAa(|)EFA()SBa(|), "| |"); + v(SAa(|)EFA()SBb(|), "| |"); + v(SAa(|)EFA()SBc(|), "| |"); + v(SAa(|)EFA()SBd(|), "| |"); + v(SAa(|)EFA()SBe(|), "| |"); + v(SAa(|)EFA()SBf(|), "| |"); + v(SAa(|)EFB()|, "| |"); + v(SAa(|)EFB()SBa(|), "| |"); + v(SAa(|)EFB()SBb(|), "| |"); + v(SAa(|)EFB()SBc(|), "| |"); + v(SAa(|)EFB()SBd(|), "| |"); + v(SAa(|)EFB()SBe(|), "| |"); + v(SAa(|)EFB()SBf(|), "| |"); + v(SAa(|)EFC()|, "| |"); + v(SAa(|)EFC()SBa(|), "| |"); + v(SAa(|)EFC()SBb(|), "| |"); + v(SAa(|)EFC()SBc(|), "| |"); + v(SAa(|)EFC()SBd(|), "| |"); + v(SAa(|)EFC()SBe(|), "| |"); + v(SAa(|)EFC()SBf(|), "| |"); + v(SAa(|) EOA|, "| |"); + v(SAa(|) EOB|, "| |"); + v(SAa(|) EOC|, "| |"); + v(SAa(|) EFA()|, "| |"); + v(SAa(|) EFA()SBa(|), "| |"); + v(SAa(|) EFA()SBb(|), "| |"); + v(SAa(|) EFA()SBc(|), "| |"); + v(SAa(|) EFA()SBd(|), "| |"); + v(SAa(|) EFA()SBe(|), "| |"); + v(SAa(|) EFA()SBf(|), "| |"); + v(SAa(|) EFB()|, "| |"); + v(SAa(|) EFB()SBa(|), "| |"); + v(SAa(|) EFB()SBb(|), "| |"); + v(SAa(|) EFB()SBc(|), "| |"); + v(SAa(|) EFB()SBd(|), "| |"); + v(SAa(|) EFB()SBe(|), "| |"); + v(SAa(|) EFB()SBf(|), "| |"); + v(SAa(|) EFC()|, "| |"); + v(SAa(|) EFC()SBa(|), "| |"); + v(SAa(|) EFC()SBb(|), "| |"); + v(SAa(|) EFC()SBc(|), "| |"); + v(SAa(|) EFC()SBd(|), "| |"); + v(SAa(|) EFC()SBe(|), "| |"); + v(SAa(|) EFC()SBf(|), "| |"); + v(SAa(|)EOA |, "| |"); + v(SAa(|)EOA SBa(|), "| |"); + v(SAa(|)EOA SBb(|), "| |"); + v(SAa(|)EOA SBc(|), "| |"); + v(SAa(|)EOA SBd(|), "| |"); + v(SAa(|)EOA SBe(|), "| |"); + v(SAa(|)EOA SBf(|), "| |"); + v(SAa(|)EOB |, "| |"); + v(SAa(|)EOB SBa(|), "| |"); + v(SAa(|)EOB SBb(|), "| |"); + v(SAa(|)EOB SBc(|), "| |"); + v(SAa(|)EOB SBd(|), "| |"); + v(SAa(|)EOB SBe(|), "| |"); + v(SAa(|)EOB SBf(|), "| |"); + v(SAa(|)EOC |, "| |"); + v(SAa(|)EOC SBa(|), "| |"); + v(SAa(|)EOC SBb(|), "| |"); + v(SAa(|)EOC SBc(|), "| |"); + v(SAa(|)EOC SBd(|), "| |"); + v(SAa(|)EOC SBe(|), "| |"); + v(SAa(|)EOC SBf(|), "| |"); + v(SAa(|)EFA() |, "| |"); + v(SAa(|)EFA() SBa(|), "| |"); + v(SAa(|)EFA() SBb(|), "| |"); + v(SAa(|)EFA() SBc(|), "| |"); + v(SAa(|)EFA() SBd(|), "| |"); + v(SAa(|)EFA() SBe(|), "| |"); + v(SAa(|)EFA() SBf(|), "| |"); + v(SAa(|)EFB() |, "| |"); + v(SAa(|)EFB() SBa(|), "| |"); + v(SAa(|)EFB() SBb(|), "| |"); + v(SAa(|)EFB() SBc(|), "| |"); + v(SAa(|)EFB() SBd(|), "| |"); + v(SAa(|)EFB() SBe(|), "| |"); + v(SAa(|)EFB() SBf(|), "| |"); + v(SAa(|)EFC() |, "| |"); + v(SAa(|)EFC() SBa(|), "| |"); + v(SAa(|)EFC() SBb(|), "| |"); + v(SAa(|)EFC() SBc(|), "| |"); + v(SAa(|)EFC() SBd(|), "| |"); + v(SAa(|)EFC() SBe(|), "| |"); + v(SAa(|)EFC() SBf(|), "| |"); + v(SAa(|) EOA |, "| |"); + v(SAa(|) EOA SBa(|), "| |"); + v(SAa(|) EOA SBb(|), "| |"); + v(SAa(|) EOA SBc(|), "| |"); + v(SAa(|) EOA SBd(|), "| |"); + v(SAa(|) EOA SBe(|), "| |"); + v(SAa(|) EOA SBf(|), "| |"); + v(SAa(|) EOB |, "| |"); + v(SAa(|) EOB SBa(|), "| |"); + v(SAa(|) EOB SBb(|), "| |"); + v(SAa(|) EOB SBc(|), "| |"); + v(SAa(|) EOB SBd(|), "| |"); + v(SAa(|) EOB SBe(|), "| |"); + v(SAa(|) EOB SBf(|), "| |"); + v(SAa(|) EOC |, "| |"); + v(SAa(|) EOC SBa(|), "| |"); + v(SAa(|) EOC SBb(|), "| |"); + v(SAa(|) EOC SBc(|), "| |"); + v(SAa(|) EOC SBd(|), "| |"); + v(SAa(|) EOC SBe(|), "| |"); + v(SAa(|) EOC SBf(|), "| |"); + v(SAa(|) EFA() |, "| |"); + v(SAa(|) EFA() SBa(|), "| |"); + v(SAa(|) EFA() SBb(|), "| |"); + v(SAa(|) EFA() SBc(|), "| |"); + v(SAa(|) EFA() SBd(|), "| |"); + v(SAa(|) EFA() SBe(|), "| |"); + v(SAa(|) EFA() SBf(|), "| |"); + v(SAa(|) EFB() |, "| |"); + v(SAa(|) EFB() SBa(|), "| |"); + v(SAa(|) EFB() SBb(|), "| |"); + v(SAa(|) EFB() SBc(|), "| |"); + v(SAa(|) EFB() SBd(|), "| |"); + v(SAa(|) EFB() SBe(|), "| |"); + v(SAa(|) EFB() SBf(|), "| |"); + v(SAa(|) EFC() |, "| |"); + v(SAa(|) EFC() SBa(|), "| |"); + v(SAa(|) EFC() SBb(|), "| |"); + v(SAa(|) EFC() SBc(|), "| |"); + v(SAa(|) EFC() SBd(|), "| |"); + v(SAa(|) EFC() SBe(|), "| |"); + v(SAa(|) EFC() SBf(|), "| |"); +} + +void +check3 (void) +{ + v(SAb(|)|, "| |"); + v(SAb(|)SBa(|), "| |"); + v(SAb(|)SBb(|), "| |"); + v(SAb(|)SBc(|), "| |"); + v(SAb(|)SBd(|), "| |"); + v(SAb(|)SBe(|), "| |"); + v(SAb(|)SBf(|), "| |"); + v(SAb(|) |, "| |"); + v(SAb(|) SBa(|), "| |"); + v(SAb(|) SBb(|), "| |"); + v(SAb(|) SBc(|), "| |"); + v(SAb(|) SBd(|), "| |"); + v(SAb(|) SBe(|), "| |"); + v(SAb(|) SBf(|), "| |"); + v(SAb(|)EOA|, "| |"); + v(SAb(|)EOB|, "| |"); + v(SAb(|)EOC|, "| |"); + v(SAb(|)EFA()|, "| |"); + v(SAb(|)EFA()SBa(|), "| |"); + v(SAb(|)EFA()SBb(|), "| |"); + v(SAb(|)EFA()SBc(|), "| |"); + v(SAb(|)EFA()SBd(|), "| |"); + v(SAb(|)EFA()SBe(|), "| |"); + v(SAb(|)EFA()SBf(|), "| |"); + v(SAb(|)EFB()|, "| |"); + v(SAb(|)EFB()SBa(|), "| |"); + v(SAb(|)EFB()SBb(|), "| |"); + v(SAb(|)EFB()SBc(|), "| |"); + v(SAb(|)EFB()SBd(|), "| |"); + v(SAb(|)EFB()SBe(|), "| |"); + v(SAb(|)EFB()SBf(|), "| |"); + v(SAb(|)EFC()|, "| |"); + v(SAb(|)EFC()SBa(|), "| |"); + v(SAb(|)EFC()SBb(|), "| |"); + v(SAb(|)EFC()SBc(|), "| |"); + v(SAb(|)EFC()SBd(|), "| |"); + v(SAb(|)EFC()SBe(|), "| |"); + v(SAb(|)EFC()SBf(|), "| |"); + v(SAb(|) EOA|, "| |"); + v(SAb(|) EOB|, "| |"); + v(SAb(|) EOC|, "| |"); + v(SAb(|) EFA()|, "| |"); + v(SAb(|) EFA()SBa(|), "| |"); + v(SAb(|) EFA()SBb(|), "| |"); + v(SAb(|) EFA()SBc(|), "| |"); + v(SAb(|) EFA()SBd(|), "| |"); + v(SAb(|) EFA()SBe(|), "| |"); + v(SAb(|) EFA()SBf(|), "| |"); + v(SAb(|) EFB()|, "| |"); + v(SAb(|) EFB()SBa(|), "| |"); + v(SAb(|) EFB()SBb(|), "| |"); + v(SAb(|) EFB()SBc(|), "| |"); + v(SAb(|) EFB()SBd(|), "| |"); + v(SAb(|) EFB()SBe(|), "| |"); + v(SAb(|) EFB()SBf(|), "| |"); + v(SAb(|) EFC()|, "| |"); + v(SAb(|) EFC()SBa(|), "| |"); + v(SAb(|) EFC()SBb(|), "| |"); + v(SAb(|) EFC()SBc(|), "| |"); + v(SAb(|) EFC()SBd(|), "| |"); + v(SAb(|) EFC()SBe(|), "| |"); + v(SAb(|) EFC()SBf(|), "| |"); + v(SAb(|)EOA |, "| |"); + v(SAb(|)EOA SBa(|), "| |"); + v(SAb(|)EOA SBb(|), "| |"); + v(SAb(|)EOA SBc(|), "| |"); + v(SAb(|)EOA SBd(|), "| |"); + v(SAb(|)EOA SBe(|), "| |"); + v(SAb(|)EOA SBf(|), "| |"); + v(SAb(|)EOB |, "| |"); + v(SAb(|)EOB SBa(|), "| |"); + v(SAb(|)EOB SBb(|), "| |"); + v(SAb(|)EOB SBc(|), "| |"); + v(SAb(|)EOB SBd(|), "| |"); + v(SAb(|)EOB SBe(|), "| |"); + v(SAb(|)EOB SBf(|), "| |"); + v(SAb(|)EOC |, "| |"); + v(SAb(|)EOC SBa(|), "| |"); + v(SAb(|)EOC SBb(|), "| |"); + v(SAb(|)EOC SBc(|), "| |"); + v(SAb(|)EOC SBd(|), "| |"); + v(SAb(|)EOC SBe(|), "| |"); + v(SAb(|)EOC SBf(|), "| |"); + v(SAb(|)EFA() |, "| |"); + v(SAb(|)EFA() SBa(|), "| |"); + v(SAb(|)EFA() SBb(|), "| |"); + v(SAb(|)EFA() SBc(|), "| |"); + v(SAb(|)EFA() SBd(|), "| |"); + v(SAb(|)EFA() SBe(|), "| |"); + v(SAb(|)EFA() SBf(|), "| |"); + v(SAb(|)EFB() |, "| |"); + v(SAb(|)EFB() SBa(|), "| |"); + v(SAb(|)EFB() SBb(|), "| |"); + v(SAb(|)EFB() SBc(|), "| |"); + v(SAb(|)EFB() SBd(|), "| |"); + v(SAb(|)EFB() SBe(|), "| |"); + v(SAb(|)EFB() SBf(|), "| |"); + v(SAb(|)EFC() |, "| |"); + v(SAb(|)EFC() SBa(|), "| |"); + v(SAb(|)EFC() SBb(|), "| |"); + v(SAb(|)EFC() SBc(|), "| |"); + v(SAb(|)EFC() SBd(|), "| |"); + v(SAb(|)EFC() SBe(|), "| |"); + v(SAb(|)EFC() SBf(|), "| |"); + v(SAb(|) EOA |, "| |"); + v(SAb(|) EOA SBa(|), "| |"); + v(SAb(|) EOA SBb(|), "| |"); + v(SAb(|) EOA SBc(|), "| |"); + v(SAb(|) EOA SBd(|), "| |"); + v(SAb(|) EOA SBe(|), "| |"); + v(SAb(|) EOA SBf(|), "| |"); + v(SAb(|) EOB |, "| |"); + v(SAb(|) EOB SBa(|), "| |"); + v(SAb(|) EOB SBb(|), "| |"); + v(SAb(|) EOB SBc(|), "| |"); + v(SAb(|) EOB SBd(|), "| |"); + v(SAb(|) EOB SBe(|), "| |"); + v(SAb(|) EOB SBf(|), "| |"); + v(SAb(|) EOC |, "| |"); + v(SAb(|) EOC SBa(|), "| |"); + v(SAb(|) EOC SBb(|), "| |"); + v(SAb(|) EOC SBc(|), "| |"); + v(SAb(|) EOC SBd(|), "| |"); + v(SAb(|) EOC SBe(|), "| |"); + v(SAb(|) EOC SBf(|), "| |"); + v(SAb(|) EFA() |, "| |"); + v(SAb(|) EFA() SBa(|), "| |"); + v(SAb(|) EFA() SBb(|), "| |"); + v(SAb(|) EFA() SBc(|), "| |"); + v(SAb(|) EFA() SBd(|), "| |"); + v(SAb(|) EFA() SBe(|), "| |"); + v(SAb(|) EFA() SBf(|), "| |"); + v(SAb(|) EFB() |, "| |"); + v(SAb(|) EFB() SBa(|), "| |"); + v(SAb(|) EFB() SBb(|), "| |"); + v(SAb(|) EFB() SBc(|), "| |"); + v(SAb(|) EFB() SBd(|), "| |"); + v(SAb(|) EFB() SBe(|), "| |"); + v(SAb(|) EFB() SBf(|), "| |"); + v(SAb(|) EFC() |, "| |"); + v(SAb(|) EFC() SBa(|), "| |"); + v(SAb(|) EFC() SBb(|), "| |"); + v(SAb(|) EFC() SBc(|), "| |"); + v(SAb(|) EFC() SBd(|), "| |"); + v(SAb(|) EFC() SBe(|), "| |"); + v(SAb(|) EFC() SBf(|), "| |"); +} + +void +check4 (void) +{ + v(SAc(|)|, "| |"); + v(SAc(|)SBa(|), "| |"); + v(SAc(|)SBb(|), "| |"); + v(SAc(|)SBc(|), "| |"); + v(SAc(|)SBd(|), "| |"); + v(SAc(|)SBe(|), "| |"); + v(SAc(|)SBf(|), "| |"); + v(SAc(|) |, "| |"); + v(SAc(|) SBa(|), "| |"); + v(SAc(|) SBb(|), "| |"); + v(SAc(|) SBc(|), "| |"); + v(SAc(|) SBd(|), "| |"); + v(SAc(|) SBe(|), "| |"); + v(SAc(|) SBf(|), "| |"); + v(SAc(|)EOA|, "| |"); + v(SAc(|)EOB|, "| |"); + v(SAc(|)EOC|, "| |"); + v(SAc(|)EFA()|, "| |"); + v(SAc(|)EFA()SBa(|), "| |"); + v(SAc(|)EFA()SBb(|), "| |"); + v(SAc(|)EFA()SBc(|), "| |"); + v(SAc(|)EFA()SBd(|), "| |"); + v(SAc(|)EFA()SBe(|), "| |"); + v(SAc(|)EFA()SBf(|), "| |"); + v(SAc(|)EFB()|, "| |"); + v(SAc(|)EFB()SBa(|), "| |"); + v(SAc(|)EFB()SBb(|), "| |"); + v(SAc(|)EFB()SBc(|), "| |"); + v(SAc(|)EFB()SBd(|), "| |"); + v(SAc(|)EFB()SBe(|), "| |"); + v(SAc(|)EFB()SBf(|), "| |"); + v(SAc(|)EFC()|, "| |"); + v(SAc(|)EFC()SBa(|), "| |"); + v(SAc(|)EFC()SBb(|), "| |"); + v(SAc(|)EFC()SBc(|), "| |"); + v(SAc(|)EFC()SBd(|), "| |"); + v(SAc(|)EFC()SBe(|), "| |"); + v(SAc(|)EFC()SBf(|), "| |"); + v(SAc(|) EOA|, "| |"); + v(SAc(|) EOB|, "| |"); + v(SAc(|) EOC|, "| |"); + v(SAc(|) EFA()|, "| |"); + v(SAc(|) EFA()SBa(|), "| |"); + v(SAc(|) EFA()SBb(|), "| |"); + v(SAc(|) EFA()SBc(|), "| |"); + v(SAc(|) EFA()SBd(|), "| |"); + v(SAc(|) EFA()SBe(|), "| |"); + v(SAc(|) EFA()SBf(|), "| |"); + v(SAc(|) EFB()|, "| |"); + v(SAc(|) EFB()SBa(|), "| |"); + v(SAc(|) EFB()SBb(|), "| |"); + v(SAc(|) EFB()SBc(|), "| |"); + v(SAc(|) EFB()SBd(|), "| |"); + v(SAc(|) EFB()SBe(|), "| |"); + v(SAc(|) EFB()SBf(|), "| |"); + v(SAc(|) EFC()|, "| |"); + v(SAc(|) EFC()SBa(|), "| |"); + v(SAc(|) EFC()SBb(|), "| |"); + v(SAc(|) EFC()SBc(|), "| |"); + v(SAc(|) EFC()SBd(|), "| |"); + v(SAc(|) EFC()SBe(|), "| |"); + v(SAc(|) EFC()SBf(|), "| |"); + v(SAc(|)EOA |, "| |"); + v(SAc(|)EOA SBa(|), "| |"); + v(SAc(|)EOA SBb(|), "| |"); + v(SAc(|)EOA SBc(|), "| |"); + v(SAc(|)EOA SBd(|), "| |"); + v(SAc(|)EOA SBe(|), "| |"); + v(SAc(|)EOA SBf(|), "| |"); + v(SAc(|)EOB |, "| |"); + v(SAc(|)EOB SBa(|), "| |"); + v(SAc(|)EOB SBb(|), "| |"); + v(SAc(|)EOB SBc(|), "| |"); + v(SAc(|)EOB SBd(|), "| |"); + v(SAc(|)EOB SBe(|), "| |"); + v(SAc(|)EOB SBf(|), "| |"); + v(SAc(|)EOC |, "| |"); + v(SAc(|)EOC SBa(|), "| |"); + v(SAc(|)EOC SBb(|), "| |"); + v(SAc(|)EOC SBc(|), "| |"); + v(SAc(|)EOC SBd(|), "| |"); + v(SAc(|)EOC SBe(|), "| |"); + v(SAc(|)EOC SBf(|), "| |"); + v(SAc(|)EFA() |, "| |"); + v(SAc(|)EFA() SBa(|), "| |"); + v(SAc(|)EFA() SBb(|), "| |"); + v(SAc(|)EFA() SBc(|), "| |"); + v(SAc(|)EFA() SBd(|), "| |"); + v(SAc(|)EFA() SBe(|), "| |"); + v(SAc(|)EFA() SBf(|), "| |"); + v(SAc(|)EFB() |, "| |"); + v(SAc(|)EFB() SBa(|), "| |"); + v(SAc(|)EFB() SBb(|), "| |"); + v(SAc(|)EFB() SBc(|), "| |"); + v(SAc(|)EFB() SBd(|), "| |"); + v(SAc(|)EFB() SBe(|), "| |"); + v(SAc(|)EFB() SBf(|), "| |"); + v(SAc(|)EFC() |, "| |"); + v(SAc(|)EFC() SBa(|), "| |"); + v(SAc(|)EFC() SBb(|), "| |"); + v(SAc(|)EFC() SBc(|), "| |"); + v(SAc(|)EFC() SBd(|), "| |"); + v(SAc(|)EFC() SBe(|), "| |"); + v(SAc(|)EFC() SBf(|), "| |"); + v(SAc(|) EOA |, "| |"); + v(SAc(|) EOA SBa(|), "| |"); + v(SAc(|) EOA SBb(|), "| |"); + v(SAc(|) EOA SBc(|), "| |"); + v(SAc(|) EOA SBd(|), "| |"); + v(SAc(|) EOA SBe(|), "| |"); + v(SAc(|) EOA SBf(|), "| |"); + v(SAc(|) EOB |, "| |"); + v(SAc(|) EOB SBa(|), "| |"); + v(SAc(|) EOB SBb(|), "| |"); + v(SAc(|) EOB SBc(|), "| |"); + v(SAc(|) EOB SBd(|), "| |"); + v(SAc(|) EOB SBe(|), "| |"); + v(SAc(|) EOB SBf(|), "| |"); + v(SAc(|) EOC |, "| |"); + v(SAc(|) EOC SBa(|), "| |"); + v(SAc(|) EOC SBb(|), "| |"); + v(SAc(|) EOC SBc(|), "| |"); + v(SAc(|) EOC SBd(|), "| |"); + v(SAc(|) EOC SBe(|), "| |"); + v(SAc(|) EOC SBf(|), "| |"); + v(SAc(|) EFA() |, "| |"); + v(SAc(|) EFA() SBa(|), "| |"); + v(SAc(|) EFA() SBb(|), "| |"); + v(SAc(|) EFA() SBc(|), "| |"); + v(SAc(|) EFA() SBd(|), "| |"); + v(SAc(|) EFA() SBe(|), "| |"); + v(SAc(|) EFA() SBf(|), "| |"); + v(SAc(|) EFB() |, "| |"); + v(SAc(|) EFB() SBa(|), "| |"); + v(SAc(|) EFB() SBb(|), "| |"); + v(SAc(|) EFB() SBc(|), "| |"); + v(SAc(|) EFB() SBd(|), "| |"); + v(SAc(|) EFB() SBe(|), "| |"); + v(SAc(|) EFB() SBf(|), "| |"); + v(SAc(|) EFC() |, "| |"); + v(SAc(|) EFC() SBa(|), "| |"); + v(SAc(|) EFC() SBb(|), "| |"); + v(SAc(|) EFC() SBc(|), "| |"); + v(SAc(|) EFC() SBd(|), "| |"); + v(SAc(|) EFC() SBe(|), "| |"); + v(SAc(|) EFC() SBf(|), "| |"); + v(SAc(|)|, "| |"); + v(SAc(|)SBa(|), "| |"); + v(SAc(|)SBb(|), "| |"); + v(SAc(|)SBc(|), "| |"); + v(SAc(|)SBd(|), "| |"); + v(SAc(|)SBe(|), "| |"); + v(SAc(|)SBf(|), "| |"); + v(SAc(|) |, "| |"); + v(SAc(|) SBa(|), "| |"); + v(SAc(|) SBb(|), "| |"); + v(SAc(|) SBc(|), "| |"); + v(SAc(|) SBd(|), "| |"); + v(SAc(|) SBe(|), "| |"); + v(SAc(|) SBf(|), "| |"); + v(SAc(|)EOA|, "| |"); + v(SAc(|)EOB|, "| |"); + v(SAc(|)EOC|, "| |"); + v(SAc(|)EFA()|, "| |"); + v(SAc(|)EFA()SBa(|), "| |"); + v(SAc(|)EFA()SBb(|), "| |"); + v(SAc(|)EFA()SBc(|), "| |"); + v(SAc(|)EFA()SBd(|), "| |"); + v(SAc(|)EFA()SBe(|), "| |"); + v(SAc(|)EFA()SBf(|), "| |"); + v(SAc(|)EFB()|, "| |"); + v(SAc(|)EFB()SBa(|), "| |"); + v(SAc(|)EFB()SBb(|), "| |"); + v(SAc(|)EFB()SBc(|), "| |"); + v(SAc(|)EFB()SBd(|), "| |"); + v(SAc(|)EFB()SBe(|), "| |"); + v(SAc(|)EFB()SBf(|), "| |"); + v(SAc(|)EFC()|, "| |"); + v(SAc(|)EFC()SBa(|), "| |"); + v(SAc(|)EFC()SBb(|), "| |"); + v(SAc(|)EFC()SBc(|), "| |"); + v(SAc(|)EFC()SBd(|), "| |"); + v(SAc(|)EFC()SBe(|), "| |"); + v(SAc(|)EFC()SBf(|), "| |"); + v(SAc(|) EOA|, "| |"); + v(SAc(|) EOB|, "| |"); + v(SAc(|) EOC|, "| |"); + v(SAc(|) EFA()|, "| |"); + v(SAc(|) EFA()SBa(|), "| |"); + v(SAc(|) EFA()SBb(|), "| |"); + v(SAc(|) EFA()SBc(|), "| |"); + v(SAc(|) EFA()SBd(|), "| |"); + v(SAc(|) EFA()SBe(|), "| |"); + v(SAc(|) EFA()SBf(|), "| |"); + v(SAc(|) EFB()|, "| |"); + v(SAc(|) EFB()SBa(|), "| |"); + v(SAc(|) EFB()SBb(|), "| |"); + v(SAc(|) EFB()SBc(|), "| |"); + v(SAc(|) EFB()SBd(|), "| |"); + v(SAc(|) EFB()SBe(|), "| |"); + v(SAc(|) EFB()SBf(|), "| |"); + v(SAc(|) EFC()|, "| |"); + v(SAc(|) EFC()SBa(|), "| |"); + v(SAc(|) EFC()SBb(|), "| |"); + v(SAc(|) EFC()SBc(|), "| |"); + v(SAc(|) EFC()SBd(|), "| |"); + v(SAc(|) EFC()SBe(|), "| |"); + v(SAc(|) EFC()SBf(|), "| |"); + v(SAc(|)EOA |, "| |"); + v(SAc(|)EOA SBa(|), "| |"); + v(SAc(|)EOA SBb(|), "| |"); + v(SAc(|)EOA SBc(|), "| |"); + v(SAc(|)EOA SBd(|), "| |"); + v(SAc(|)EOA SBe(|), "| |"); + v(SAc(|)EOA SBf(|), "| |"); + v(SAc(|)EOB |, "| |"); + v(SAc(|)EOB SBa(|), "| |"); + v(SAc(|)EOB SBb(|), "| |"); + v(SAc(|)EOB SBc(|), "| |"); + v(SAc(|)EOB SBd(|), "| |"); + v(SAc(|)EOB SBe(|), "| |"); + v(SAc(|)EOB SBf(|), "| |"); + v(SAc(|)EOC |, "| |"); + v(SAc(|)EOC SBa(|), "| |"); + v(SAc(|)EOC SBb(|), "| |"); + v(SAc(|)EOC SBc(|), "| |"); + v(SAc(|)EOC SBd(|), "| |"); + v(SAc(|)EOC SBe(|), "| |"); + v(SAc(|)EOC SBf(|), "| |"); + v(SAc(|)EFA() |, "| |"); + v(SAc(|)EFA() SBa(|), "| |"); + v(SAc(|)EFA() SBb(|), "| |"); + v(SAc(|)EFA() SBc(|), "| |"); + v(SAc(|)EFA() SBd(|), "| |"); + v(SAc(|)EFA() SBe(|), "| |"); + v(SAc(|)EFA() SBf(|), "| |"); + v(SAc(|)EFB() |, "| |"); + v(SAc(|)EFB() SBa(|), "| |"); + v(SAc(|)EFB() SBb(|), "| |"); + v(SAc(|)EFB() SBc(|), "| |"); + v(SAc(|)EFB() SBd(|), "| |"); + v(SAc(|)EFB() SBe(|), "| |"); + v(SAc(|)EFB() SBf(|), "| |"); + v(SAc(|)EFC() |, "| |"); + v(SAc(|)EFC() SBa(|), "| |"); + v(SAc(|)EFC() SBb(|), "| |"); + v(SAc(|)EFC() SBc(|), "| |"); + v(SAc(|)EFC() SBd(|), "| |"); + v(SAc(|)EFC() SBe(|), "| |"); + v(SAc(|)EFC() SBf(|), "| |"); + v(SAc(|) EOA |, "| |"); + v(SAc(|) EOA SBa(|), "| |"); + v(SAc(|) EOA SBb(|), "| |"); + v(SAc(|) EOA SBc(|), "| |"); + v(SAc(|) EOA SBd(|), "| |"); + v(SAc(|) EOA SBe(|), "| |"); + v(SAc(|) EOA SBf(|), "| |"); + v(SAc(|) EOB |, "| |"); + v(SAc(|) EOB SBa(|), "| |"); + v(SAc(|) EOB SBb(|), "| |"); + v(SAc(|) EOB SBc(|), "| |"); + v(SAc(|) EOB SBd(|), "| |"); + v(SAc(|) EOB SBe(|), "| |"); + v(SAc(|) EOB SBf(|), "| |"); + v(SAc(|) EOC |, "| |"); + v(SAc(|) EOC SBa(|), "| |"); + v(SAc(|) EOC SBb(|), "| |"); + v(SAc(|) EOC SBc(|), "| |"); + v(SAc(|) EOC SBd(|), "| |"); + v(SAc(|) EOC SBe(|), "| |"); + v(SAc(|) EOC SBf(|), "| |"); + v(SAc(|) EFA() |, "| |"); + v(SAc(|) EFA() SBa(|), "| |"); + v(SAc(|) EFA() SBb(|), "| |"); + v(SAc(|) EFA() SBc(|), "| |"); + v(SAc(|) EFA() SBd(|), "| |"); + v(SAc(|) EFA() SBe(|), "| |"); + v(SAc(|) EFA() SBf(|), "| |"); + v(SAc(|) EFB() |, "| |"); + v(SAc(|) EFB() SBa(|), "| |"); + v(SAc(|) EFB() SBb(|), "| |"); + v(SAc(|) EFB() SBc(|), "| |"); + v(SAc(|) EFB() SBd(|), "| |"); + v(SAc(|) EFB() SBe(|), "| |"); + v(SAc(|) EFB() SBf(|), "| |"); + v(SAc(|) EFC() |, "| |"); + v(SAc(|) EFC() SBa(|), "| |"); + v(SAc(|) EFC() SBb(|), "| |"); + v(SAc(|) EFC() SBc(|), "| |"); + v(SAc(|) EFC() SBd(|), "| |"); + v(SAc(|) EFC() SBe(|), "| |"); + v(SAc(|) EFC() SBf(|), "| |"); +} + +void +check5 (void) +{ + v(SAd(|)|, "| |"); + v(SAd(|)SBa(|), "| |"); + v(SAd(|)SBb(|), "| |"); + v(SAd(|)SBc(|), "| |"); + v(SAd(|)SBd(|), "| |"); + v(SAd(|)SBe(|), "| |"); + v(SAd(|)SBf(|), "| |"); + v(SAd(|) |, "| |"); + v(SAd(|) SBa(|), "| |"); + v(SAd(|) SBb(|), "| |"); + v(SAd(|) SBc(|), "| |"); + v(SAd(|) SBd(|), "| |"); + v(SAd(|) SBe(|), "| |"); + v(SAd(|) SBf(|), "| |"); + v(SAd(|)EOA|, "| |"); + v(SAd(|)EOB|, "| |"); + v(SAd(|)EOC|, "| |"); + v(SAd(|)EFA()|, "| |"); + v(SAd(|)EFA()SBa(|), "| |"); + v(SAd(|)EFA()SBb(|), "| |"); + v(SAd(|)EFA()SBc(|), "| |"); + v(SAd(|)EFA()SBd(|), "| |"); + v(SAd(|)EFA()SBe(|), "| |"); + v(SAd(|)EFA()SBf(|), "| |"); + v(SAd(|)EFB()|, "| |"); + v(SAd(|)EFB()SBa(|), "| |"); + v(SAd(|)EFB()SBb(|), "| |"); + v(SAd(|)EFB()SBc(|), "| |"); + v(SAd(|)EFB()SBd(|), "| |"); + v(SAd(|)EFB()SBe(|), "| |"); + v(SAd(|)EFB()SBf(|), "| |"); + v(SAd(|)EFC()|, "| |"); + v(SAd(|)EFC()SBa(|), "| |"); + v(SAd(|)EFC()SBb(|), "| |"); + v(SAd(|)EFC()SBc(|), "| |"); + v(SAd(|)EFC()SBd(|), "| |"); + v(SAd(|)EFC()SBe(|), "| |"); + v(SAd(|)EFC()SBf(|), "| |"); + v(SAd(|) EOA|, "| |"); + v(SAd(|) EOB|, "| |"); + v(SAd(|) EOC|, "| |"); + v(SAd(|) EFA()|, "| |"); + v(SAd(|) EFA()SBa(|), "| |"); + v(SAd(|) EFA()SBb(|), "| |"); + v(SAd(|) EFA()SBc(|), "| |"); + v(SAd(|) EFA()SBd(|), "| |"); + v(SAd(|) EFA()SBe(|), "| |"); + v(SAd(|) EFA()SBf(|), "| |"); + v(SAd(|) EFB()|, "| |"); + v(SAd(|) EFB()SBa(|), "| |"); + v(SAd(|) EFB()SBb(|), "| |"); + v(SAd(|) EFB()SBc(|), "| |"); + v(SAd(|) EFB()SBd(|), "| |"); + v(SAd(|) EFB()SBe(|), "| |"); + v(SAd(|) EFB()SBf(|), "| |"); + v(SAd(|) EFC()|, "| |"); + v(SAd(|) EFC()SBa(|), "| |"); + v(SAd(|) EFC()SBb(|), "| |"); + v(SAd(|) EFC()SBc(|), "| |"); + v(SAd(|) EFC()SBd(|), "| |"); + v(SAd(|) EFC()SBe(|), "| |"); + v(SAd(|) EFC()SBf(|), "| |"); + v(SAd(|)EOA |, "| |"); + v(SAd(|)EOA SBa(|), "| |"); + v(SAd(|)EOA SBb(|), "| |"); + v(SAd(|)EOA SBc(|), "| |"); + v(SAd(|)EOA SBd(|), "| |"); + v(SAd(|)EOA SBe(|), "| |"); + v(SAd(|)EOA SBf(|), "| |"); + v(SAd(|)EOB |, "| |"); + v(SAd(|)EOB SBa(|), "| |"); + v(SAd(|)EOB SBb(|), "| |"); + v(SAd(|)EOB SBc(|), "| |"); + v(SAd(|)EOB SBd(|), "| |"); + v(SAd(|)EOB SBe(|), "| |"); + v(SAd(|)EOB SBf(|), "| |"); + v(SAd(|)EOC |, "| |"); + v(SAd(|)EOC SBa(|), "| |"); + v(SAd(|)EOC SBb(|), "| |"); + v(SAd(|)EOC SBc(|), "| |"); + v(SAd(|)EOC SBd(|), "| |"); + v(SAd(|)EOC SBe(|), "| |"); + v(SAd(|)EOC SBf(|), "| |"); + v(SAd(|)EFA() |, "| |"); + v(SAd(|)EFA() SBa(|), "| |"); + v(SAd(|)EFA() SBb(|), "| |"); + v(SAd(|)EFA() SBc(|), "| |"); + v(SAd(|)EFA() SBd(|), "| |"); + v(SAd(|)EFA() SBe(|), "| |"); + v(SAd(|)EFA() SBf(|), "| |"); + v(SAd(|)EFB() |, "| |"); + v(SAd(|)EFB() SBa(|), "| |"); + v(SAd(|)EFB() SBb(|), "| |"); + v(SAd(|)EFB() SBc(|), "| |"); + v(SAd(|)EFB() SBd(|), "| |"); + v(SAd(|)EFB() SBe(|), "| |"); + v(SAd(|)EFB() SBf(|), "| |"); + v(SAd(|)EFC() |, "| |"); + v(SAd(|)EFC() SBa(|), "| |"); + v(SAd(|)EFC() SBb(|), "| |"); + v(SAd(|)EFC() SBc(|), "| |"); + v(SAd(|)EFC() SBd(|), "| |"); + v(SAd(|)EFC() SBe(|), "| |"); + v(SAd(|)EFC() SBf(|), "| |"); + v(SAd(|) EOA |, "| |"); + v(SAd(|) EOA SBa(|), "| |"); + v(SAd(|) EOA SBb(|), "| |"); + v(SAd(|) EOA SBc(|), "| |"); + v(SAd(|) EOA SBd(|), "| |"); + v(SAd(|) EOA SBe(|), "| |"); + v(SAd(|) EOA SBf(|), "| |"); + v(SAd(|) EOB |, "| |"); + v(SAd(|) EOB SBa(|), "| |"); + v(SAd(|) EOB SBb(|), "| |"); + v(SAd(|) EOB SBc(|), "| |"); + v(SAd(|) EOB SBd(|), "| |"); + v(SAd(|) EOB SBe(|), "| |"); + v(SAd(|) EOB SBf(|), "| |"); + v(SAd(|) EOC |, "| |"); + v(SAd(|) EOC SBa(|), "| |"); + v(SAd(|) EOC SBb(|), "| |"); + v(SAd(|) EOC SBc(|), "| |"); + v(SAd(|) EOC SBd(|), "| |"); + v(SAd(|) EOC SBe(|), "| |"); + v(SAd(|) EOC SBf(|), "| |"); + v(SAd(|) EFA() |, "| |"); + v(SAd(|) EFA() SBa(|), "| |"); + v(SAd(|) EFA() SBb(|), "| |"); + v(SAd(|) EFA() SBc(|), "| |"); + v(SAd(|) EFA() SBd(|), "| |"); + v(SAd(|) EFA() SBe(|), "| |"); + v(SAd(|) EFA() SBf(|), "| |"); + v(SAd(|) EFB() |, "| |"); + v(SAd(|) EFB() SBa(|), "| |"); + v(SAd(|) EFB() SBb(|), "| |"); + v(SAd(|) EFB() SBc(|), "| |"); + v(SAd(|) EFB() SBd(|), "| |"); + v(SAd(|) EFB() SBe(|), "| |"); + v(SAd(|) EFB() SBf(|), "| |"); + v(SAd(|) EFC() |, "| |"); + v(SAd(|) EFC() SBa(|), "| |"); + v(SAd(|) EFC() SBb(|), "| |"); + v(SAd(|) EFC() SBc(|), "| |"); + v(SAd(|) EFC() SBd(|), "| |"); + v(SAd(|) EFC() SBe(|), "| |"); + v(SAd(|) EFC() SBf(|), "| |"); +} + +void +check6 (void) +{ + v(SAe(|)|, "| |"); + v(SAe(|)SBa(|), "| |"); + v(SAe(|)SBb(|), "| |"); + v(SAe(|)SBc(|), "| |"); + v(SAe(|)SBd(|), "| |"); + v(SAe(|)SBe(|), "| |"); + v(SAe(|)SBf(|), "| |"); + v(SAe(|) |, "| |"); + v(SAe(|) SBa(|), "| |"); + v(SAe(|) SBb(|), "| |"); + v(SAe(|) SBc(|), "| |"); + v(SAe(|) SBd(|), "| |"); + v(SAe(|) SBe(|), "| |"); + v(SAe(|) SBf(|), "| |"); + v(SAe(|)EOA|, "| |"); + v(SAe(|)EOB|, "| |"); + v(SAe(|)EOC|, "| |"); + v(SAe(|)EFA()|, "| |"); + v(SAe(|)EFA()SBa(|), "| |"); + v(SAe(|)EFA()SBb(|), "| |"); + v(SAe(|)EFA()SBc(|), "| |"); + v(SAe(|)EFA()SBd(|), "| |"); + v(SAe(|)EFA()SBe(|), "| |"); + v(SAe(|)EFA()SBf(|), "| |"); + v(SAe(|)EFB()|, "| |"); + v(SAe(|)EFB()SBa(|), "| |"); + v(SAe(|)EFB()SBb(|), "| |"); + v(SAe(|)EFB()SBc(|), "| |"); + v(SAe(|)EFB()SBd(|), "| |"); + v(SAe(|)EFB()SBe(|), "| |"); + v(SAe(|)EFB()SBf(|), "| |"); + v(SAe(|)EFC()|, "| |"); + v(SAe(|)EFC()SBa(|), "| |"); + v(SAe(|)EFC()SBb(|), "| |"); + v(SAe(|)EFC()SBc(|), "| |"); + v(SAe(|)EFC()SBd(|), "| |"); + v(SAe(|)EFC()SBe(|), "| |"); + v(SAe(|)EFC()SBf(|), "| |"); + v(SAe(|) EOA|, "| |"); + v(SAe(|) EOB|, "| |"); + v(SAe(|) EOC|, "| |"); + v(SAe(|) EFA()|, "| |"); + v(SAe(|) EFA()SBa(|), "| |"); + v(SAe(|) EFA()SBb(|), "| |"); + v(SAe(|) EFA()SBc(|), "| |"); + v(SAe(|) EFA()SBd(|), "| |"); + v(SAe(|) EFA()SBe(|), "| |"); + v(SAe(|) EFA()SBf(|), "| |"); + v(SAe(|) EFB()|, "| |"); + v(SAe(|) EFB()SBa(|), "| |"); + v(SAe(|) EFB()SBb(|), "| |"); + v(SAe(|) EFB()SBc(|), "| |"); + v(SAe(|) EFB()SBd(|), "| |"); + v(SAe(|) EFB()SBe(|), "| |"); + v(SAe(|) EFB()SBf(|), "| |"); + v(SAe(|) EFC()|, "| |"); + v(SAe(|) EFC()SBa(|), "| |"); + v(SAe(|) EFC()SBb(|), "| |"); + v(SAe(|) EFC()SBc(|), "| |"); + v(SAe(|) EFC()SBd(|), "| |"); + v(SAe(|) EFC()SBe(|), "| |"); + v(SAe(|) EFC()SBf(|), "| |"); + v(SAe(|)EOA |, "| |"); + v(SAe(|)EOA SBa(|), "| |"); + v(SAe(|)EOA SBb(|), "| |"); + v(SAe(|)EOA SBc(|), "| |"); + v(SAe(|)EOA SBd(|), "| |"); + v(SAe(|)EOA SBe(|), "| |"); + v(SAe(|)EOA SBf(|), "| |"); + v(SAe(|)EOB |, "| |"); + v(SAe(|)EOB SBa(|), "| |"); + v(SAe(|)EOB SBb(|), "| |"); + v(SAe(|)EOB SBc(|), "| |"); + v(SAe(|)EOB SBd(|), "| |"); + v(SAe(|)EOB SBe(|), "| |"); + v(SAe(|)EOB SBf(|), "| |"); + v(SAe(|)EOC |, "| |"); + v(SAe(|)EOC SBa(|), "| |"); + v(SAe(|)EOC SBb(|), "| |"); + v(SAe(|)EOC SBc(|), "| |"); + v(SAe(|)EOC SBd(|), "| |"); + v(SAe(|)EOC SBe(|), "| |"); + v(SAe(|)EOC SBf(|), "| |"); + v(SAe(|)EFA() |, "| |"); + v(SAe(|)EFA() SBa(|), "| |"); + v(SAe(|)EFA() SBb(|), "| |"); + v(SAe(|)EFA() SBc(|), "| |"); + v(SAe(|)EFA() SBd(|), "| |"); + v(SAe(|)EFA() SBe(|), "| |"); + v(SAe(|)EFA() SBf(|), "| |"); + v(SAe(|)EFB() |, "| |"); + v(SAe(|)EFB() SBa(|), "| |"); + v(SAe(|)EFB() SBb(|), "| |"); + v(SAe(|)EFB() SBc(|), "| |"); + v(SAe(|)EFB() SBd(|), "| |"); + v(SAe(|)EFB() SBe(|), "| |"); + v(SAe(|)EFB() SBf(|), "| |"); + v(SAe(|)EFC() |, "| |"); + v(SAe(|)EFC() SBa(|), "| |"); + v(SAe(|)EFC() SBb(|), "| |"); + v(SAe(|)EFC() SBc(|), "| |"); + v(SAe(|)EFC() SBd(|), "| |"); + v(SAe(|)EFC() SBe(|), "| |"); + v(SAe(|)EFC() SBf(|), "| |"); + v(SAe(|) EOA |, "| |"); + v(SAe(|) EOA SBa(|), "| |"); + v(SAe(|) EOA SBb(|), "| |"); + v(SAe(|) EOA SBc(|), "| |"); + v(SAe(|) EOA SBd(|), "| |"); + v(SAe(|) EOA SBe(|), "| |"); + v(SAe(|) EOA SBf(|), "| |"); + v(SAe(|) EOB |, "| |"); + v(SAe(|) EOB SBa(|), "| |"); + v(SAe(|) EOB SBb(|), "| |"); + v(SAe(|) EOB SBc(|), "| |"); + v(SAe(|) EOB SBd(|), "| |"); + v(SAe(|) EOB SBe(|), "| |"); + v(SAe(|) EOB SBf(|), "| |"); + v(SAe(|) EOC |, "| |"); + v(SAe(|) EOC SBa(|), "| |"); + v(SAe(|) EOC SBb(|), "| |"); + v(SAe(|) EOC SBc(|), "| |"); + v(SAe(|) EOC SBd(|), "| |"); + v(SAe(|) EOC SBe(|), "| |"); + v(SAe(|) EOC SBf(|), "| |"); + v(SAe(|) EFA() |, "| |"); + v(SAe(|) EFA() SBa(|), "| |"); + v(SAe(|) EFA() SBb(|), "| |"); + v(SAe(|) EFA() SBc(|), "| |"); + v(SAe(|) EFA() SBd(|), "| |"); + v(SAe(|) EFA() SBe(|), "| |"); + v(SAe(|) EFA() SBf(|), "| |"); + v(SAe(|) EFB() |, "| |"); + v(SAe(|) EFB() SBa(|), "| |"); + v(SAe(|) EFB() SBb(|), "| |"); + v(SAe(|) EFB() SBc(|), "| |"); + v(SAe(|) EFB() SBd(|), "| |"); + v(SAe(|) EFB() SBe(|), "| |"); + v(SAe(|) EFB() SBf(|), "| |"); + v(SAe(|) EFC() |, "| |"); + v(SAe(|) EFC() SBa(|), "| |"); + v(SAe(|) EFC() SBb(|), "| |"); + v(SAe(|) EFC() SBc(|), "| |"); + v(SAe(|) EFC() SBd(|), "| |"); + v(SAe(|) EFC() SBe(|), "| |"); + v(SAe(|) EFC() SBf(|), "| |"); +} + +void +check7 (void) +{ + v(SAf(|)|, "| |"); + v(SAf(|)SBa(|), "| |"); + v(SAf(|)SBb(|), "| |"); + v(SAf(|)SBc(|), "| |"); + v(SAf(|)SBd(|), "| |"); + v(SAf(|)SBe(|), "| |"); + v(SAf(|)SBf(|), "| |"); + v(SAf(|) |, "| |"); + v(SAf(|) SBa(|), "| |"); + v(SAf(|) SBb(|), "| |"); + v(SAf(|) SBc(|), "| |"); + v(SAf(|) SBd(|), "| |"); + v(SAf(|) SBe(|), "| |"); + v(SAf(|) SBf(|), "| |"); + v(SAf(|)EOA|, "| |"); + v(SAf(|)EOB|, "| |"); + v(SAf(|)EOC|, "| |"); + v(SAf(|)EFA()|, "| |"); + v(SAf(|)EFA()SBa(|), "| |"); + v(SAf(|)EFA()SBb(|), "| |"); + v(SAf(|)EFA()SBc(|), "| |"); + v(SAf(|)EFA()SBd(|), "| |"); + v(SAf(|)EFA()SBe(|), "| |"); + v(SAf(|)EFA()SBf(|), "| |"); + v(SAf(|)EFB()|, "| |"); + v(SAf(|)EFB()SBa(|), "| |"); + v(SAf(|)EFB()SBb(|), "| |"); + v(SAf(|)EFB()SBc(|), "| |"); + v(SAf(|)EFB()SBd(|), "| |"); + v(SAf(|)EFB()SBe(|), "| |"); + v(SAf(|)EFB()SBf(|), "| |"); + v(SAf(|)EFC()|, "| |"); + v(SAf(|)EFC()SBa(|), "| |"); + v(SAf(|)EFC()SBb(|), "| |"); + v(SAf(|)EFC()SBc(|), "| |"); + v(SAf(|)EFC()SBd(|), "| |"); + v(SAf(|)EFC()SBe(|), "| |"); + v(SAf(|)EFC()SBf(|), "| |"); + v(SAf(|) EOA|, "| |"); + v(SAf(|) EOB|, "| |"); + v(SAf(|) EOC|, "| |"); + v(SAf(|) EFA()|, "| |"); + v(SAf(|) EFA()SBa(|), "| |"); + v(SAf(|) EFA()SBb(|), "| |"); + v(SAf(|) EFA()SBc(|), "| |"); + v(SAf(|) EFA()SBd(|), "| |"); + v(SAf(|) EFA()SBe(|), "| |"); + v(SAf(|) EFA()SBf(|), "| |"); + v(SAf(|) EFB()|, "| |"); + v(SAf(|) EFB()SBa(|), "| |"); + v(SAf(|) EFB()SBb(|), "| |"); + v(SAf(|) EFB()SBc(|), "| |"); + v(SAf(|) EFB()SBd(|), "| |"); + v(SAf(|) EFB()SBe(|), "| |"); + v(SAf(|) EFB()SBf(|), "| |"); + v(SAf(|) EFC()|, "| |"); + v(SAf(|) EFC()SBa(|), "| |"); + v(SAf(|) EFC()SBb(|), "| |"); + v(SAf(|) EFC()SBc(|), "| |"); + v(SAf(|) EFC()SBd(|), "| |"); + v(SAf(|) EFC()SBe(|), "| |"); + v(SAf(|) EFC()SBf(|), "| |"); + v(SAf(|)EOA |, "| |"); + v(SAf(|)EOA SBa(|), "| |"); + v(SAf(|)EOA SBb(|), "| |"); + v(SAf(|)EOA SBc(|), "| |"); + v(SAf(|)EOA SBd(|), "| |"); + v(SAf(|)EOA SBe(|), "| |"); + v(SAf(|)EOA SBf(|), "| |"); + v(SAf(|)EOB |, "| |"); + v(SAf(|)EOB SBa(|), "| |"); + v(SAf(|)EOB SBb(|), "| |"); + v(SAf(|)EOB SBc(|), "| |"); + v(SAf(|)EOB SBd(|), "| |"); + v(SAf(|)EOB SBe(|), "| |"); + v(SAf(|)EOB SBf(|), "| |"); + v(SAf(|)EOC |, "| |"); + v(SAf(|)EOC SBa(|), "| |"); + v(SAf(|)EOC SBb(|), "| |"); + v(SAf(|)EOC SBc(|), "| |"); + v(SAf(|)EOC SBd(|), "| |"); + v(SAf(|)EOC SBe(|), "| |"); + v(SAf(|)EOC SBf(|), "| |"); + v(SAf(|)EFA() |, "| |"); + v(SAf(|)EFA() SBa(|), "| |"); + v(SAf(|)EFA() SBb(|), "| |"); + v(SAf(|)EFA() SBc(|), "| |"); + v(SAf(|)EFA() SBd(|), "| |"); + v(SAf(|)EFA() SBe(|), "| |"); + v(SAf(|)EFA() SBf(|), "| |"); + v(SAf(|)EFB() |, "| |"); + v(SAf(|)EFB() SBa(|), "| |"); + v(SAf(|)EFB() SBb(|), "| |"); + v(SAf(|)EFB() SBc(|), "| |"); + v(SAf(|)EFB() SBd(|), "| |"); + v(SAf(|)EFB() SBe(|), "| |"); + v(SAf(|)EFB() SBf(|), "| |"); + v(SAf(|)EFC() |, "| |"); + v(SAf(|)EFC() SBa(|), "| |"); + v(SAf(|)EFC() SBb(|), "| |"); + v(SAf(|)EFC() SBc(|), "| |"); + v(SAf(|)EFC() SBd(|), "| |"); + v(SAf(|)EFC() SBe(|), "| |"); + v(SAf(|)EFC() SBf(|), "| |"); + v(SAf(|) EOA |, "| |"); + v(SAf(|) EOA SBa(|), "| |"); + v(SAf(|) EOA SBb(|), "| |"); + v(SAf(|) EOA SBc(|), "| |"); + v(SAf(|) EOA SBd(|), "| |"); + v(SAf(|) EOA SBe(|), "| |"); + v(SAf(|) EOA SBf(|), "| |"); + v(SAf(|) EOB |, "| |"); + v(SAf(|) EOB SBa(|), "| |"); + v(SAf(|) EOB SBb(|), "| |"); + v(SAf(|) EOB SBc(|), "| |"); + v(SAf(|) EOB SBd(|), "| |"); + v(SAf(|) EOB SBe(|), "| |"); + v(SAf(|) EOB SBf(|), "| |"); + v(SAf(|) EOC |, "| |"); + v(SAf(|) EOC SBa(|), "| |"); + v(SAf(|) EOC SBb(|), "| |"); + v(SAf(|) EOC SBc(|), "| |"); + v(SAf(|) EOC SBd(|), "| |"); + v(SAf(|) EOC SBe(|), "| |"); + v(SAf(|) EOC SBf(|), "| |"); + v(SAf(|) EFA() |, "| |"); + v(SAf(|) EFA() SBa(|), "| |"); + v(SAf(|) EFA() SBb(|), "| |"); + v(SAf(|) EFA() SBc(|), "| |"); + v(SAf(|) EFA() SBd(|), "| |"); + v(SAf(|) EFA() SBe(|), "| |"); + v(SAf(|) EFA() SBf(|), "| |"); + v(SAf(|) EFB() |, "| |"); + v(SAf(|) EFB() SBa(|), "| |"); + v(SAf(|) EFB() SBb(|), "| |"); + v(SAf(|) EFB() SBc(|), "| |"); + v(SAf(|) EFB() SBd(|), "| |"); + v(SAf(|) EFB() SBe(|), "| |"); + v(SAf(|) EFB() SBf(|), "| |"); + v(SAf(|) EFC() |, "| |"); + v(SAf(|) EFC() SBa(|), "| |"); + v(SAf(|) EFC() SBb(|), "| |"); + v(SAf(|) EFC() SBc(|), "| |"); + v(SAf(|) EFC() SBd(|), "| |"); + v(SAf(|) EFC() SBe(|), "| |"); + v(SAf(|) EFC() SBf(|), "| |"); +} + +int +main (void) +{ + check0 (); + check1 (); + check2 (); + check3 (); + check4 (); + check5 (); + check6 (); + check7 (); + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/short-circuit.c b/gcc/testsuite/gcc.dg/debug/dwarf2/short-circuit.c new file mode 100644 index 00000000000..7e745ff19d2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/short-circuit.c @@ -0,0 +1,108 @@ +/* { dg-do compile } */ +/* { dg-options "-O0 -gdwarf-2 -dA" } */ + +#define True 1 +#define False 0 + +_Bool F1 (_Bool B1, _Bool B2) +{ + _Bool R; + + if (B1 + && B2) + R = True; + else + R = False; + return R; +} + +_Bool F2 (_Bool B1, _Bool B2) +{ + _Bool R; + + R = B1 + && B2; + return R; +} + +_Bool F3 (_Bool B1, _Bool B2) +{ + _Bool R = False; + + if (B1 + && B2) + R = True; + return R; +} + +_Bool F4 (_Bool B1, _Bool B2) +{ + _Bool R = False; + + if (B1 + || B2) + ; + else + R = True; + return R; +} + +_Bool F5 (_Bool B1, _Bool B2) +{ + _Bool R = False; + + if (!(B1 + && B2)) + R = True; + return R; +} + +_Bool F8 (_Bool B1, _Bool B2, _Bool B3, _Bool B4, _Bool B5, _Bool B6, + _Bool B7, _Bool B8) +{ + _Bool R; + + if ((B1 + || B2) + && B3 + && !(B4 + || B5) + && (B6 + || (B7 + && B8))) + R = True; + else + R = False; + return R; +} + +/* { dg-final { scan-assembler "short-circuit.c:11" } } */ +/* { dg-final { scan-assembler "short-circuit.c:12" } } */ +/* { dg-final { scan-assembler "short-circuit.c:13" } } */ +/* { dg-final { scan-assembler "short-circuit.c:15" } } */ + +/* { dg-final { scan-assembler "short-circuit.c:23" } } */ +/* { dg-final { scan-assembler "short-circuit.c:24" } } */ + +/* { dg-final { scan-assembler "short-circuit.c:32" } } */ +/* { dg-final { scan-assembler "short-circuit.c:33" } } */ +/* { dg-final { scan-assembler "short-circuit.c:34" } } */ + +/* { dg-final { scan-assembler "short-circuit.c:42" } } */ +/* { dg-final { scan-assembler "short-circuit.c:43" } } */ +/* { dg-final { scan-assembler "short-circuit.c:46" } } */ + +/* { dg-final { scan-assembler "short-circuit.c:54" } } */ +/* { dg-final { scan-assembler "short-circuit.c:55" } } */ +/* { dg-final { scan-assembler "short-circuit.c:56" } } */ + +/* { dg-final { scan-assembler "short-circuit.c:65" } } */ +/* { dg-final { scan-assembler "short-circuit.c:66" } } */ +/* { dg-final { scan-assembler "short-circuit.c:67" } } */ +/* { dg-final { scan-assembler "short-circuit.c:68" } } */ +/* { dg-final { scan-assembler "short-circuit.c:69" } } */ +/* { dg-final { scan-assembler "short-circuit.c:70" } } */ +/* { dg-final { scan-assembler "short-circuit.c:71" } } */ +/* { dg-final { scan-assembler "short-circuit.c:72" } } */ +/* { dg-final { scan-assembler "short-circuit.c:73" } } */ +/* { dg-final { scan-assembler "short-circuit.c:75" } } */ diff --git a/gcc/testsuite/gcc.dg/dfp/pr36800.c b/gcc/testsuite/gcc.dg/dfp/pr36800.c new file mode 100644 index 00000000000..5b899cf0e7f --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/pr36800.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99" } */ + +#include <stdarg.h> +extern void abort (void); + +void +f (int a, ...) +{ + va_list ap; + if (a != 0) + abort (); + va_start (ap, a); + if (va_arg (ap, _Decimal128) != 1.2DL) + abort (); + if (va_arg (ap, _Decimal128) != 2.34DL) + abort (); + if (va_arg (ap, _Decimal128) != 3.456DL) + abort (); + if (va_arg (ap, _Decimal128) != 4.567DL) + abort (); + if (va_arg (ap, double) != 5.125) + abort (); + va_end (ap); +} + +int +main (void) +{ + f (0, 1.2DL, 2.34DL, 3.456DL, 4.567DL, 5.125); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/enum-const-1.c b/gcc/testsuite/gcc.dg/enum-const-1.c new file mode 100644 index 00000000000..205bb237214 --- /dev/null +++ b/gcc/testsuite/gcc.dg/enum-const-1.c @@ -0,0 +1,8 @@ +/* Test for enumeration constants not integer constant expressions but + folding to integer constants (used in Linux kernel, + <http://gcc.gnu.org/ml/gcc/2009-04/msg00677.html>). */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +extern int i; +enum e { E = (1 ? 1 : i) }; diff --git a/gcc/testsuite/gcc.dg/enum-const-2.c b/gcc/testsuite/gcc.dg/enum-const-2.c new file mode 100644 index 00000000000..7e83a6ff45f --- /dev/null +++ b/gcc/testsuite/gcc.dg/enum-const-2.c @@ -0,0 +1,8 @@ +/* Test for enumeration constants not integer constant expressions but + folding to integer constants (used in Linux kernel, + <http://gcc.gnu.org/ml/gcc/2009-04/msg00677.html>). */ +/* { dg-do compile } */ +/* { dg-options "-pedantic" } */ + +extern int i; +enum e { E = (1 ? 1 : i) }; /* { dg-warning "not an integer constant expression" } */ diff --git a/gcc/testsuite/gcc.dg/enum-const-3.c b/gcc/testsuite/gcc.dg/enum-const-3.c new file mode 100644 index 00000000000..ab355cafe1f --- /dev/null +++ b/gcc/testsuite/gcc.dg/enum-const-3.c @@ -0,0 +1,8 @@ +/* Test for enumeration constants not integer constant expressions but + folding to integer constants (used in Linux kernel, + <http://gcc.gnu.org/ml/gcc/2009-04/msg00677.html>). */ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ + +extern int i; +enum e { E = (1 ? 1 : i) }; /* { dg-error "not an integer constant expression" } */ diff --git a/gcc/testsuite/gcc.dg/fixed-point/fixed-point.exp b/gcc/testsuite/gcc.dg/fixed-point/fixed-point.exp index fb7e73d1866..bdb241f48af 100644 --- a/gcc/testsuite/gcc.dg/fixed-point/fixed-point.exp +++ b/gcc/testsuite/gcc.dg/fixed-point/fixed-point.exp @@ -1,8 +1,8 @@ -# Copyright (C) 1997, 2004 Free Software Foundation, Inc. +# Copyright (C) 1997, 2004, 2009 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, @@ -11,8 +11,8 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. # GCC testsuite that uses the `dg.exp' driver. diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-1.c b/gcc/testsuite/gcc.dg/format/gcc_diag-1.c index f8af0ea4d9e..6bfa3ceb232 100644 --- a/gcc/testsuite/gcc.dg/format/gcc_diag-1.c +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-1.c @@ -137,7 +137,7 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p, cxxdiag ("%+H", loc); /* { dg-warning "format" "bogus modifier" } */ diag ("%D", t1); /* { dg-warning "format" "bogus tree" } */ tdiag ("%A", t1); /* { dg-warning "format" "bogus tree" } */ - tdiag ("%E", t1); /* { dg-warning "format" "bogus tree" } */ + tdiag ("%E", t1); tdiag ("%#D", t1); /* { dg-warning "format" "bogus modifier" } */ cdiag ("%A", t1); /* { dg-warning "format" "bogus tree" } */ cdiag ("%#D", t1); /* { dg-warning "format" "bogus modifier" } */ diff --git a/gcc/testsuite/gcc.dg/framework-2.c b/gcc/testsuite/gcc.dg/framework-2.c index 7e71b51b687..0bc0b294e20 100644 --- a/gcc/testsuite/gcc.dg/framework-2.c +++ b/gcc/testsuite/gcc.dg/framework-2.c @@ -1,4 +1,6 @@ /* { dg-do compile { target *-*-darwin* } } */ /* { dg-options "-F$srcdir/gcc.dg" } */ -#include <Foundation/Foundation.h> /* { dg-error "Foundation/Foundation.h: No such file" } */ +#include <Foundation/Foundation.h> /* { dg-error "Foundation/Foundation.h" } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ + diff --git a/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c b/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c index ebc68859a5e..4fd6671a4db 100644 --- a/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c +++ b/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c @@ -1,7 +1,7 @@ /* Test for constant expressions: GNU extensions. */ /* Origin: Joseph Myers <joseph@codesourcery.com> */ /* { dg-do compile } */ -/* { dg-options "-std=gnu89" } */ +/* { dg-options "-std=gnu89 -pedantic-errors" } */ int n; @@ -9,39 +9,48 @@ void f (void) { int i = 0; - int a[n]; + int a[n]; /* { dg-error "ISO C90 forbids variable length array" } */ enum e1 { /* Integer constant expressions may not contain statement expressions (not a permitted operand). */ - E1 = (1 ? 0 : ({ 0; })), /* { dg-error "constant" } */ + E1 = (1 ? 0 : ({ 0; })), /* { dg-error "constant expression" } */ + /* { dg-error "ISO C forbids braced-groups" "ISO" { target *-*-* } 16 } */ /* Real and imaginary parts act like other arithmetic operators. */ - E2 = __real__ (1 ? 0 : i++), /* { dg-error "constant" } */ + E2 = __real__ (1 ? 0 : i++), /* { dg-error "constant expression" } */ E3 = __real__ 0, E4 = __imag__ (1 ? 0 : i++), /* { dg-error "constant" } */ E5 = __imag__ 0, /* __alignof__ always constant. */ - E6 = __alignof__ (int[n]), + E6 = __alignof__ (int[n]), /* { dg-error "ISO C90 forbids variable length array" } */ E7 = __alignof__ (a), /* __extension__ ignored for constant expression purposes. */ - E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant" } */ + E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant expression" } */ E9 = __extension__ 0, /* Conditional expressions with omitted arguments act like the standard type. */ - E10 = (1 ? : i++), /* { dg-error "constant" } */ - E11 = (1 ? : 0) + E10 = (1 ? : i++), /* { dg-error "constant expression" } */ + /* { dg-error "ISO C forbids omitting" "ISO" { target *-*-* } 32 } */ + E11 = (1 ? : 0) /* { dg-error "ISO C forbids omitting" } */ }; enum e2 { /* Complex integer constants may be cast directly to integer types, but not after further arithmetic on them. */ - F1 = (int) (_Complex int) 2i, /* { dg-error "constant" } */ - F2 = (int) +2i, /* { dg-error "constant" } */ - F3 = (int) (1 + 2i), /* { dg-error "constant" } */ - F4 = (int) 2i + F1 = (int) (_Complex int) 2i, /* { dg-error "constant expression" } */ + /* { dg-error "complex" "complex" { target *-*-* } 39 } */ + /* { dg-error "imaginary" "imaginary" { target *-*-* } 39 } */ + F2 = (int) +2i, /* { dg-error "constant expression" } */ + /* { dg-error "imaginary" "ISO" { target *-*-* } 42 } */ + F3 = (int) (1 + 2i), /* { dg-error "constant expression" } */ + /* { dg-error "imaginary" "ISO" { target *-*-* } 44 } */ + F4 = (int) 2i /* { dg-error "imaginary" } */ }; static double dr = __real__ (1.0 + 2.0i); + /* { dg-error "imaginary" "ISO" { target *-*-* } 48 } */ static double di = __imag__ (1.0 + 2.0i); + /* { dg-error "imaginary" "ISO" { target *-*-* } 50 } */ /* Statement expressions allowed in unevaluated subexpressions in initializers in gnu99 but not gnu89. */ - static int j = (1 ? 0 : ({ 0; })); /* { dg-warning "constant expression" } */ + static int j = (1 ? 0 : ({ 0; })); /* { dg-error "constant expression" } */ + /* { dg-error "braced" "ISO" { target *-*-* } 54 } */ } diff --git a/gcc/testsuite/gcc.dg/gnu89-const-expr-2.c b/gcc/testsuite/gcc.dg/gnu89-const-expr-2.c index 3395b55c733..fd4d18ed908 100644 --- a/gcc/testsuite/gcc.dg/gnu89-const-expr-2.c +++ b/gcc/testsuite/gcc.dg/gnu89-const-expr-2.c @@ -20,4 +20,7 @@ f (void) a = __builtin_choose_expr ((void *)0, b, c); /* { dg-error "constant" } */ a = __builtin_choose_expr (0 * (INT_MAX + 1), b, c); /* { dg-warning "integer overflow in expression" } */ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 21 } */ + a = __builtin_choose_expr (1 / 0, 0, 0); /* { dg-warning "division by zero" } */ + /* { dg-error "not a constant" "error" { target *-*-* } 23 } */ + a = __builtin_choose_expr ((1 ? 1 : a), b, c); /* { dg-error "constant" } */ } diff --git a/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c b/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c index dcc976e5582..3f5f25e6d2e 100644 --- a/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c +++ b/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c @@ -1,7 +1,7 @@ /* Test for constant expressions: GNU extensions. */ /* Origin: Joseph Myers <joseph@codesourcery.com> */ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ +/* { dg-options "-std=gnu99 -pedantic-errors" } */ int n; @@ -13,10 +13,11 @@ f (void) enum e1 { /* Integer constant expressions may not contain statement expressions (not a permitted operand). */ - E1 = (1 ? 0 : ({ 0; })), /* { dg-error "constant" } */ + E1 = (1 ? 0 : ({ 0; })), /* { dg-error "constant expression" } */ + /* { dg-error "ISO C forbids braced-groups" "ISO" { target *-*-* } 16 } */ /* Real and imaginary parts act like other arithmetic operators. */ - E2 = __real__ (1 ? 0 : i++), /* { dg-error "constant" } */ + E2 = __real__ (1 ? 0 : i++), /* { dg-error "constant expression" } */ E3 = __real__ 0, E4 = __imag__ (1 ? 0 : i++), /* { dg-error "constant" } */ E5 = __imag__ 0, @@ -24,24 +25,32 @@ f (void) E6 = __alignof__ (int[n]), E7 = __alignof__ (a), /* __extension__ ignored for constant expression purposes. */ - E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant" } */ + E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant expression" } */ E9 = __extension__ 0, /* Conditional expressions with omitted arguments act like the standard type. */ - E10 = (1 ? : i++), /* { dg-error "constant" } */ - E11 = (1 ? : 0) + E10 = (1 ? : i++), /* { dg-error "constant expression" } */ + /* { dg-error "ISO C forbids omitting" "ISO" { target *-*-* } 32 } */ + E11 = (1 ? : 0) /* { dg-error "ISO C forbids omitting" } */ }; enum e2 { /* Complex integer constants may be cast directly to integer types, but not after further arithmetic on them. */ - F1 = (int) (_Complex int) 2i, /* { dg-error "constant" } */ - F2 = (int) +2i, /* { dg-error "constant" } */ - F3 = (int) (1 + 2i), /* { dg-error "constant" } */ - F4 = (int) 2i + F1 = (int) (_Complex int) 2i, /* { dg-error "constant expression" } */ + /* { dg-error "complex" "complex" { target *-*-* } 39 } */ + /* { dg-error "imaginary" "imaginary" { target *-*-* } 39 } */ + F2 = (int) +2i, /* { dg-error "constant expression" } */ + /* { dg-error "imaginary" "ISO" { target *-*-* } 42 } */ + F3 = (int) (1 + 2i), /* { dg-error "constant expression" } */ + /* { dg-error "imaginary" "ISO" { target *-*-* } 44 } */ + F4 = (int) 2i /* { dg-error "imaginary" } */ }; static double dr = __real__ (1.0 + 2.0i); + /* { dg-error "imaginary" "ISO" { target *-*-* } 48 } */ static double di = __imag__ (1.0 + 2.0i); + /* { dg-error "imaginary" "ISO" { target *-*-* } 50 } */ /* Statement expressions allowed in unevaluated subexpressions in initializers in gnu99 but not gnu89. */ static int j = (1 ? 0 : ({ 0; })); + /* { dg-error "braced" "ISO" { target *-*-* } 54 } */ } diff --git a/gcc/testsuite/gcc.dg/gnu99-const-expr-2.c b/gcc/testsuite/gcc.dg/gnu99-const-expr-2.c index f868c537fa2..f9acef81a94 100644 --- a/gcc/testsuite/gcc.dg/gnu99-const-expr-2.c +++ b/gcc/testsuite/gcc.dg/gnu99-const-expr-2.c @@ -20,4 +20,7 @@ f (void) a = __builtin_choose_expr ((void *)0, b, c); /* { dg-error "constant" } */ a = __builtin_choose_expr (0 * (INT_MAX + 1), b, c); /* { dg-warning "integer overflow in expression" } */ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 21 } */ + a = __builtin_choose_expr (1 / 0, 0, 0); /* { dg-warning "division by zero" } */ + /* { dg-error "not a constant" "error" { target *-*-* } 23 } */ + a = __builtin_choose_expr ((1 ? 1 : a), b, c); /* { dg-error "constant" } */ } diff --git a/gcc/testsuite/gcc.dg/gnu99-const-expr-4.c b/gcc/testsuite/gcc.dg/gnu99-const-expr-4.c new file mode 100644 index 00000000000..baaa63031a5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gnu99-const-expr-4.c @@ -0,0 +1,29 @@ +/* Test for constant expressions: cases involving VLAs and typeof, at + file scope. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99 -pedantic-errors" } */ + +/* It appears address constants may contain casts to variably modified + types. Whether they should be permitted was discussed in + <http://groups.google.com/group/comp.std.c/msg/923eee5ab690fd98> + <LV7g2Vy3ARF$Ew9Q@romana.davros.org>; since static pointers to VLAs + are definitely permitted within functions and may be initialized + and such initialization involves implicit conversion to a variably + modified type, allowing explicit casts seems appropriate. Thus, + GCC allows them as long as the "evaluated" size expressions do not + contain the various operators not permitted to be evaluated in a + constant expression, and as long as the result is genuinely + constant (meaning that pointer arithmetic using the size of the VLA + is generally not permitted). */ + +static int sa[100]; +int m; +int n; + +static int (*a1)[] = &sa; +static int (*a2)[] = (__typeof__(int (*)[n]))sa; +static int (*a4)[] = (__typeof__((int (*)[n])sa))sa; +static int (*a5)[] = (__typeof__((int (*)[m++])sa))sa; /* { dg-error "constant" } */ +static int (*a6)[] = (__typeof__((int (*)[100])(int (*)[m++])sa))sa; +static int (*a7)[] = (__typeof__((int (*)[n])sa + m++))sa; /* { dg-error "constant" } */ diff --git a/gcc/testsuite/gcc.dg/gomp/combined-1.c b/gcc/testsuite/gcc.dg/gomp/combined-1.c index fc86a9b0e32..7e2346572a2 100644 --- a/gcc/testsuite/gcc.dg/gomp/combined-1.c +++ b/gcc/testsuite/gcc.dg/gomp/combined-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fopenmp -fdump-tree-final_cleanup" } */ +/* { dg-options "-O1 -fopenmp -fdump-tree-optimized" } */ int a[10]; int foo (void) @@ -20,5 +20,5 @@ int foo (void) } } -/* { dg-final { scan-tree-dump-times "__builtin_GOMP_parallel_loop_runtime_start" 3 "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_GOMP_parallel_loop_runtime_start" 3 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/gomp/gomp.exp b/gcc/testsuite/gcc.dg/gomp/gomp.exp index 7ce426deb79..e4f31cca924 100644 --- a/gcc/testsuite/gcc.dg/gomp/gomp.exp +++ b/gcc/testsuite/gcc.dg/gomp/gomp.exp @@ -1,3 +1,21 @@ +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + # GCC testsuite that uses the `dg.exp' driver. # Load support procs. diff --git a/gcc/testsuite/gcc.dg/inline-34.c b/gcc/testsuite/gcc.dg/inline-34.c new file mode 100644 index 00000000000..f257792c73c --- /dev/null +++ b/gcc/testsuite/gcc.dg/inline-34.c @@ -0,0 +1,19 @@ +/* Diagnostics for bad references to static objects and functions from + inline definitions must take account of declarations after the + definition which make it not an inline definition. PR 39556. */ +/* { dg-do compile } */ +/* { dg-options "-std=c99 -pedantic-errors" } */ + +static int a1; +inline int f1 (void) { return a1; } +int f1 (void); + +static int a2; +inline int f2 (void) { return a2; } +extern inline int f2 (void); + +inline void f3 (void) { static int a3; } +void f3 (void); + +inline void f4 (void) { static int a4; } +extern inline void f4 (void); diff --git a/gcc/testsuite/gcc.dg/lvalue-5.c b/gcc/testsuite/gcc.dg/lvalue-5.c new file mode 100644 index 00000000000..514f35ed802 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lvalue-5.c @@ -0,0 +1,14 @@ +/* Test assignment to elements of a string literal is a warning, not + an error. PR 27676. */ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ + +void +f (void) +{ + "foo"[0] = 0; /* { dg-warning "assignment of read-only location" } */ + "foo"[0]++; /* { dg-warning "increment of read-only location" } */ + "foo"[0]--; /* { dg-warning "decrement of read-only location" } */ + ++"foo"[0]; /* { dg-warning "increment of read-only location" } */ + --"foo"[0]; /* { dg-warning "decrement of read-only location" } */ +} diff --git a/gcc/testsuite/gcc.dg/lvalue-6.c b/gcc/testsuite/gcc.dg/lvalue-6.c new file mode 100644 index 00000000000..af69de4df4c --- /dev/null +++ b/gcc/testsuite/gcc.dg/lvalue-6.c @@ -0,0 +1,17 @@ +/* Test constraints on unary '&': PR 22367. */ + +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */ + +extern void v; +void f1 (void) { &v; } /* { dg-error "taking address of expression of type 'void'" } */ + +extern void *pv; +void f2 (void) { &*pv; } /* { dg-warning "dereferencing" } */ +/* { dg-error "taking address of expression of type 'void'" "C90 only error" { target *-*-* } 10 } */ + +extern const void cv; +void f3 (void) { &cv; } + +extern const void *pcv; +void f4 (void) { &*pcv; } /* { dg-warning "dereferencing" } */ diff --git a/gcc/testsuite/gcc.dg/lvalue-7.c b/gcc/testsuite/gcc.dg/lvalue-7.c new file mode 100644 index 00000000000..37964e1cd76 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lvalue-7.c @@ -0,0 +1,16 @@ +/* Test constraints on unary '&': PR 22367. */ + +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ + +extern void v; +void f1 (void) { &v; } /* { dg-error "taking address of expression of type 'void'" } */ + +extern void *pv; +void f2 (void) { &*pv; } /* { dg-warning "dereferencing" } */ + +extern const void cv; +void f3 (void) { &cv; } + +extern const void *pcv; +void f4 (void) { &*pcv; } /* { dg-warning "dereferencing" } */ diff --git a/gcc/testsuite/gcc.dg/no-strict-overflow-1.c b/gcc/testsuite/gcc.dg/no-strict-overflow-1.c index 6d449cac15e..b83b3ae80d3 100644 --- a/gcc/testsuite/gcc.dg/no-strict-overflow-1.c +++ b/gcc/testsuite/gcc.dg/no-strict-overflow-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */ /* Source: Ian Lance Taylor. Dual of strict-overflow-1.c. */ @@ -12,5 +12,5 @@ foo (int i) return i - 5 < 10; } -/* { dg-final { scan-tree-dump "-[ ]*5" "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump "-[ ]*5" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/no-strict-overflow-2.c b/gcc/testsuite/gcc.dg/no-strict-overflow-2.c index cfe4bc16feb..aec8960ad52 100644 --- a/gcc/testsuite/gcc.dg/no-strict-overflow-2.c +++ b/gcc/testsuite/gcc.dg/no-strict-overflow-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */ /* Source: Ian Lance Taylor. Dual of strict-overflow-2.c. */ @@ -12,5 +12,5 @@ foo (int i) return (i * 100) / 10; } -/* { dg-final { scan-tree-dump "100" "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump "100" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/no-strict-overflow-3.c b/gcc/testsuite/gcc.dg/no-strict-overflow-3.c index a98117981d5..e34e9183c0c 100644 --- a/gcc/testsuite/gcc.dg/no-strict-overflow-3.c +++ b/gcc/testsuite/gcc.dg/no-strict-overflow-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */ /* Source: Ian Lance Taylor. Dual of strict-overflow-3.c. */ @@ -12,5 +12,5 @@ foo (int i, int j) return i + 100 < j + 1000; } -/* { dg-final { scan-tree-dump "1000" "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump "1000" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/no-strict-overflow-4.c b/gcc/testsuite/gcc.dg/no-strict-overflow-4.c index da6264a7289..32d35c4cb4b 100644 --- a/gcc/testsuite/gcc.dg/no-strict-overflow-4.c +++ b/gcc/testsuite/gcc.dg/no-strict-overflow-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */ /* Source: Ian Lance Taylor. Dual of strict-overflow-4.c. */ @@ -14,6 +14,6 @@ foo (int i) /* We expect to see "<bb N>"; confirm that, so that we know to count it in the real test. */ -/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "final_cleanup" } } */ -/* { dg-final { scan-tree-dump-times ">|<" 3 "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times ">|<" 3 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/no-strict-overflow-5.c b/gcc/testsuite/gcc.dg/no-strict-overflow-5.c index 7f82014c76e..a63bf342b56 100644 --- a/gcc/testsuite/gcc.dg/no-strict-overflow-5.c +++ b/gcc/testsuite/gcc.dg/no-strict-overflow-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */ /* Dual of strict-overflow-5.c. */ @@ -16,5 +16,5 @@ int foo (int i) return r; } -/* { dg-final { scan-tree-dump-times "r = 3" 0 "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "r = 3" 0 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/no-strict-overflow-6.c b/gcc/testsuite/gcc.dg/no-strict-overflow-6.c index 664aa256af5..43200bb20bc 100644 --- a/gcc/testsuite/gcc.dg/no-strict-overflow-6.c +++ b/gcc/testsuite/gcc.dg/no-strict-overflow-6.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */ /* Source: Ian Lance Taylor. */ @@ -17,5 +17,5 @@ foo () return bits; } -/* { dg-final { scan-tree-dump "return bits" "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump "return bits" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/no-strict-overflow-7.c b/gcc/testsuite/gcc.dg/no-strict-overflow-7.c index 07ad27b1f87..c237af98407 100644 --- a/gcc/testsuite/gcc.dg/no-strict-overflow-7.c +++ b/gcc/testsuite/gcc.dg/no-strict-overflow-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */ /* Source: Ian Lance Taylor. Dual of strict-overflow-6.c. */ @@ -12,5 +12,5 @@ foo (char* p) return p + 1000 < p; } -/* { dg-final { scan-tree-dump "\[+\]\[ \]*1000" "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump "\[+\]\[ \]*1000" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/overflow-warn-1.c b/gcc/testsuite/gcc.dg/overflow-warn-1.c index 633d70b84b5..0cf08a3e77f 100644 --- a/gcc/testsuite/gcc.dg/overflow-warn-1.c +++ b/gcc/testsuite/gcc.dg/overflow-warn-1.c @@ -49,7 +49,7 @@ static int sc = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */ /* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 49 } */ void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */ -/* { dg-error "initializer element is not constant" "constant" { target *-*-* } 51 } */ +/* { dg-error "initializer element is not computable at load time" "constant" { target *-*-* } 51 } */ /* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 51 } */ void *r = (1 ? 0 : INT_MAX+1); diff --git a/gcc/testsuite/gcc.dg/overflow-warn-2.c b/gcc/testsuite/gcc.dg/overflow-warn-2.c index e8bbd24455d..f6595d508c2 100644 --- a/gcc/testsuite/gcc.dg/overflow-warn-2.c +++ b/gcc/testsuite/gcc.dg/overflow-warn-2.c @@ -49,7 +49,7 @@ static int sc = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */ /* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 49 } */ void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */ -/* { dg-error "initializer element is not constant" "constant" { target *-*-* } 51 } */ +/* { dg-error "initializer element is not computable at load time" "constant" { target *-*-* } 51 } */ /* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 51 } */ void *r = (1 ? 0 : INT_MAX+1); diff --git a/gcc/testsuite/gcc.dg/overflow-warn-3.c b/gcc/testsuite/gcc.dg/overflow-warn-3.c index d9a3ae430db..fae26d4101d 100644 --- a/gcc/testsuite/gcc.dg/overflow-warn-3.c +++ b/gcc/testsuite/gcc.dg/overflow-warn-3.c @@ -55,7 +55,7 @@ void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 54 } */ /* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 54 } */ void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */ -/* { dg-error "initializer element is not constant" "constant" { target *-*-* } 57 } */ +/* { dg-error "initializer element is not computable at load time" "constant" { target *-*-* } 57 } */ /* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 57 } */ void *r = (1 ? 0 : INT_MAX+1); diff --git a/gcc/testsuite/gcc.dg/overflow-warn-4.c b/gcc/testsuite/gcc.dg/overflow-warn-4.c index 7b7e23cef4b..464533a365d 100644 --- a/gcc/testsuite/gcc.dg/overflow-warn-4.c +++ b/gcc/testsuite/gcc.dg/overflow-warn-4.c @@ -55,7 +55,7 @@ void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 54 } */ /* { dg-error "initialization makes pointer from integer without a cast" "null" { target *-*-* } 54 } */ void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */ -/* { dg-error "initializer element is not constant" "constant" { target *-*-* } 57 } */ +/* { dg-error "initializer element is not computable at load time" "constant" { target *-*-* } 57 } */ /* { dg-error "initialization makes pointer from integer without a cast" "null" { target *-*-* } 57 } */ void *r = (1 ? 0 : INT_MAX+1); diff --git a/gcc/testsuite/gcc.dg/pr15784-4.c b/gcc/testsuite/gcc.dg/pr15784-4.c index 0d31697a9a3..6549c720555 100644 --- a/gcc/testsuite/gcc.dg/pr15784-4.c +++ b/gcc/testsuite/gcc.dg/pr15784-4.c @@ -8,6 +8,6 @@ int b (int x) { return -x -1; /* ~x */ } -/* { dg-final { scan-tree-dump "~x;" "optimized" } } */ -/* { dg-final { scan-tree-dump "-x;" "optimized" } } */ +/* { dg-final { scan-tree-dump "~x_..D.;" "optimized" } } */ +/* { dg-final { scan-tree-dump "-x_..D.;" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/pr27150-1.c b/gcc/testsuite/gcc.dg/pr27150-1.c index 03810cd7e15..5a00cf9f90f 100644 --- a/gcc/testsuite/gcc.dg/pr27150-1.c +++ b/gcc/testsuite/gcc.dg/pr27150-1.c @@ -1,7 +1,14 @@ -/* { dg-do compile } */ +/* { dg-do link } */ /* { dg-options "-O2" } */ +extern int link_error (); int g(int f) { - return (&f)!=0; + int a = ((&f)!=0); + if (!a) link_error (); + return a; } +int main() +{ + g(10); +} diff --git a/gcc/testsuite/gcc.dg/pr32061.c b/gcc/testsuite/gcc.dg/pr32061.c new file mode 100644 index 00000000000..dc1a916f1bb --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr32061.c @@ -0,0 +1,10 @@ +/* PR c/32061 + { dg-do compile } + { dg-options "-Wlogical-op -Wall -Wextra" } +*/ +#define FORCE 1 +#define FLAG 1 +int func (int resp, int flags) +{ + return (resp && (FORCE || (FLAG & flags))); +} diff --git a/gcc/testsuite/gcc.dg/pr34263.c b/gcc/testsuite/gcc.dg/pr34263.c index 10df9d81fc0..d389eade88e 100644 --- a/gcc/testsuite/gcc.dg/pr34263.c +++ b/gcc/testsuite/gcc.dg/pr34263.c @@ -54,6 +54,6 @@ int look( struct s *p, struct s **pp ) return( 1 ); } -/* { dg-final { scan-tree-dump "Cleaned-up latch block of loop with single BB" "optimized" } } */ +/* { dg-final { scan-tree-dump "Cleaned-up latch block of loop with single BB" "optimized" { xfail { *-*-* } } } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/pr36902.c b/gcc/testsuite/gcc.dg/pr36902.c new file mode 100644 index 00000000000..43a2d14f981 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr36902.c @@ -0,0 +1,61 @@ +/* PR middle-end/36902 Array bound warning with dead code after optimization */ +/* { dg-do compile } */ +/* { dg-options "-O2 -Warray-bounds -Wall -Wextra" } */ +typedef unsigned char __u8; +typedef unsigned short __u16; + +static inline unsigned char * +foo(unsigned char * to, const unsigned char * from, int n) +{ + switch ( n ) + { + case 3: + *to = *from; + break; + case 5: + to[4] = from [4]; + break; + } + return to; +} + +struct { + int size_of_select; + unsigned char pcr_select[4]; +} sel; + +int bar(void) +{ + static unsigned char buf[64]; + + sel.size_of_select = 3; + foo(buf, sel.pcr_select, sel.size_of_select); + + return 1; +} + + +static inline unsigned char * +foo2(unsigned char * to, const unsigned char * from, int n) +{ + switch ( n ) + { + case 3: + *to = *from; + break; + case 5: + to[4] = from [4]; /* { dg-warning "array subscript is above array bounds" } */ + break; + } + return to; +} + +int baz(void) +{ + static unsigned char buf[64]; + + sel.size_of_select = 5; + foo2(buf, sel.pcr_select, sel.size_of_select); + + return 1; +} diff --git a/gcc/testsuite/gcc.dg/pr39712.c b/gcc/testsuite/gcc.dg/pr39712.c new file mode 100644 index 00000000000..9846e33cd9f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr39712.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ + +int is_table[2][16]; +int is_table_lsf[2][2][16]; +void compute_stereo() +{ + int (*is_tab)[16]; + is_tab = is_table; +} diff --git a/gcc/testsuite/gcc.dg/pr39794.c b/gcc/testsuite/gcc.dg/pr39794.c new file mode 100644 index 00000000000..2702ba79ae6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr39794.c @@ -0,0 +1,33 @@ +/* PR rtl-optimization/39794 */ +/* { dg-do run } */ +/* { dg-options "-O2 -funroll-loops" } */ + +extern void abort (); + +void +foo (int *a, int n) +{ + int i; + for (i = 0; i < n; i++) + { + a[i] *= 2; + a[i + 1] = a[i - 1] + a[i - 2]; + } +} + +int a[16]; +int ref[16] = { 0, 1, 4, 2, 10, 12, 24, 44, + 72, 136, 232, 416, 736, 1296, 2304, 2032 }; + +int +main () +{ + int i; + for (i = 0; i < 16; i++) + a[i] = i; + foo (a + 2, 16 - 3); + for (i = 0; i < 16; i++) + if (ref[i] != a[i]) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr39867.c b/gcc/testsuite/gcc.dg/pr39867.c new file mode 100644 index 00000000000..cb797245292 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr39867.c @@ -0,0 +1,12 @@ +/* { dg-do link } */ +/* { dg-options "-O2" } */ + +int main (void) +{ + int exp = -1; + /* Wrong folding of the LHS to an unsigned MAX leads to 4294967295 != 2. */ + if ((exp < 2 ? 2U : (unsigned int) exp) != 2) + link_error (); + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/profile-generate-3.c b/gcc/testsuite/gcc.dg/profile-generate-3.c new file mode 100644 index 00000000000..307045afe04 --- /dev/null +++ b/gcc/testsuite/gcc.dg/profile-generate-3.c @@ -0,0 +1,9 @@ +/* { dg-do link } */ +/* { dg-options "-fprofile-generate=." } */ + +int +main () +{ + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/sequence-pt-1.c b/gcc/testsuite/gcc.dg/sequence-pt-1.c index 3b9214233cd..05eee82c176 100644 --- a/gcc/testsuite/gcc.dg/sequence-pt-1.c +++ b/gcc/testsuite/gcc.dg/sequence-pt-1.c @@ -30,10 +30,10 @@ foo (int a, int b, int n, int p, int *ptr, struct s *sptr, ap[n] = bp[n++]; /* { dg-warning "undefined" "sequence point warning" } */ ap[--n] = bp[n]; /* { dg-warning "undefined" "sequence point warning" } */ ap[++n] = bp[--n]; /* { dg-warning "undefined" "sequence point warning" } */ - cp[n][n] = cp[n][n]++; /* { dg-warning "undefined" "sequence point warning" { xfail *-*-* } } */ + cp[n][n] = cp[n][n]++; /* { dg-warning "undefined" "sequence point warning" } */ cp[n][p] = cp[n][n++]; /* { dg-warning "undefined" "sequence point warning" } */ *ptr++ = (size_t)ptr++; /* { dg-warning "undefined" "sequence point warning" } */ - sptr->a = sptr->a++; /* { dg-warning "undefined" "sequence point warning" { xfail *-*-* } } */ + sptr->a = sptr->a++; /* { dg-warning "undefined" "sequence point warning" } */ sptr->a = (size_t)(sptr++); /* { dg-warning "undefined" "sequence point warning" } */ *ptr++ = fn (*ptr); /* { dg-warning "undefined" "sequence point warning" } */ a = b = a++; /* { dg-warning "undefined" "sequence point warning" } */ diff --git a/gcc/testsuite/gcc.dg/sequence-pt-2.c b/gcc/testsuite/gcc.dg/sequence-pt-2.c new file mode 100644 index 00000000000..9a4b618ea53 --- /dev/null +++ b/gcc/testsuite/gcc.dg/sequence-pt-2.c @@ -0,0 +1,46 @@ +/* More sequence point warning tests */ +/* { dg-do compile } */ +/* { dg-options "-Wsequence-point" } */ + +struct s { struct s *nxt; int v; } q; + +int x[10]; + +int foo(int *p) +{ + int i = 0; + + /* Test general-lvalue sequence point warnings */ + (*p) = (*p)++; /* { dg-warning "undefined" "sequence point warning" } */ + p[3] = p[3]++; /* { dg-warning "undefined" "sequence point warning" } */ + p[i] = p[i]++; /* { dg-warning "undefined" "sequence point warning" } */ + x[3] = x[3]++; /* { dg-warning "undefined" "sequence point warning" } */ + q.nxt->nxt->v = q.nxt->nxt->v++; /* { dg-warning "undefined" "sequence point warning" } */ + + /* test expressions that appear elsewhere in the C grammar */ + + { int a = i-i++; (void)a;} /* { dg-warning "undefined" "sequence point warning" } */ + + if ((i-i++) != 0) /* { dg-warning "undefined" "sequence point warning" } */ + return i-i++; /* { dg-warning "undefined" "sequence point warning" } */ + + for (i-i++;;) /* { dg-warning "undefined" "sequence point warning" } */ + ; + + for (; (i-i++) != 0; ) /* { dg-warning "undefined" "sequence point warning" } */ + ; + + for (;;i-i++) /* { dg-warning "undefined" "sequence point warning" } */ + ; + + while ((i-i++) != 0) /* { dg-warning "undefined" "sequence point warning" } */ + ; + + do {} while ((i-i++) != 0); /* { dg-warning "undefined" "sequence point warning" } */ + + switch (i-i++) { /* { dg-warning "undefined" "sequence point warning" } */ + case 0: return 1; + } + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/sequence-pt-3.c b/gcc/testsuite/gcc.dg/sequence-pt-3.c new file mode 100644 index 00000000000..58971ca186d --- /dev/null +++ b/gcc/testsuite/gcc.dg/sequence-pt-3.c @@ -0,0 +1,15 @@ +/* More sequence point warning tests */ +/* { dg-do compile } */ +/* { dg-options "-Wsequence-point" } */ + +void bar(int i, int j) +{ + return; +} + +void foo (int i) +{ + int a = i-i++; (void)a; /* { dg-warning "undefined" "sequence point warning" } */ + + bar (i--, i++); /* { dg-warning "undefined" "sequence point warning" } */ +} diff --git a/gcc/testsuite/gcc.dg/strict-overflow-1.c b/gcc/testsuite/gcc.dg/strict-overflow-1.c index 1ff96f4584f..f37dbd54f7f 100644 --- a/gcc/testsuite/gcc.dg/strict-overflow-1.c +++ b/gcc/testsuite/gcc.dg/strict-overflow-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fstrict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */ /* Source: Ian Lance Taylor. Dual of no-strict-overflow-1.c. */ @@ -12,5 +12,5 @@ foo (int i) return i - 5 < 10; } -/* { dg-final { scan-tree-dump-not "-[ ]*5" "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-not "-\[ \]*5" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/strict-overflow-2.c b/gcc/testsuite/gcc.dg/strict-overflow-2.c index c1ec195e7ee..fd2dc69204d 100644 --- a/gcc/testsuite/gcc.dg/strict-overflow-2.c +++ b/gcc/testsuite/gcc.dg/strict-overflow-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fstrict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */ /* Source: Ian Lance Taylor. Dual of no-strict-overflow-2.c. */ @@ -12,5 +12,5 @@ foo (int i) return (i * 100) / 10; } -/* { dg-final { scan-tree-dump-not "100" "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-not "100" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/strict-overflow-3.c b/gcc/testsuite/gcc.dg/strict-overflow-3.c index f179324a2fb..bdde003a14d 100644 --- a/gcc/testsuite/gcc.dg/strict-overflow-3.c +++ b/gcc/testsuite/gcc.dg/strict-overflow-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fstrict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */ /* Source: Ian Lance Taylor. Dual of no-strict-overflow-3.c. */ @@ -12,5 +12,5 @@ foo (int i, int j) return i + 100 < j + 1000; } -/* { dg-final { scan-tree-dump-not "1000" "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-not "1000" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/strict-overflow-4.c b/gcc/testsuite/gcc.dg/strict-overflow-4.c index c89db2193ba..1a8c4ed4330 100644 --- a/gcc/testsuite/gcc.dg/strict-overflow-4.c +++ b/gcc/testsuite/gcc.dg/strict-overflow-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fstrict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */ /* Source: Ian Lance Taylor. Dual of no-strict-overflow-4.c. */ @@ -14,6 +14,6 @@ foo (int i) /* We expect to see "<bb N>"; confirm that, so that we know to count it in the real test. */ -/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "final_cleanup" } } */ -/* { dg-final { scan-tree-dump-times ">|<" 2 "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times ">|<" 2 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/strict-overflow-6.c b/gcc/testsuite/gcc.dg/strict-overflow-6.c index ec1266d1b49..d8251f4cf19 100644 --- a/gcc/testsuite/gcc.dg/strict-overflow-6.c +++ b/gcc/testsuite/gcc.dg/strict-overflow-6.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fstrict-overflow -O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */ /* Source: Ian Lance Taylor. Dual of no-strict-overflow-7.c. */ @@ -12,5 +12,5 @@ foo (char* p) return p + 1000 < p; } -/* { dg-final { scan-tree-dump-not "\[+\]\[ \]*1000" "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-not "\[+\]\[ \]*1000" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp b/gcc/testsuite/gcc.dg/struct/struct-reorg.exp index e6a2b7728a5..9a1797f3cc2 100644 --- a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp +++ b/gcc/testsuite/gcc.dg/struct/struct-reorg.exp @@ -1,8 +1,8 @@ -# Copyright (C) 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, @@ -11,8 +11,8 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. # Test the functionality of programs compiled with profile-directed structure # rearrangement using -fprofile-generate followed by -fprofile-use. diff --git a/gcc/testsuite/gcc.dg/torture/pr39678.c b/gcc/testsuite/gcc.dg/torture/pr39678.c new file mode 100644 index 00000000000..5411fbbc1cd --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr39678.c @@ -0,0 +1,27 @@ +/* PR target/39678 */ +/* { dg-do run } */ +/* { dg-options "-Wno-psabi" } */ + +struct X { + signed char c; + __complex__ float val; +}; + +struct X __attribute__((noinline)) +foo (float *p) +{ + struct X x; + x.c = -3; + __real x.val = p[0]; + __imag x.val = p[1]; + return x; +} +extern void abort (void); +float a[2] = { 3., -2. }; +int main() +{ + struct X x = foo(a); + if (x.c != -3 || __real x.val != a[0] || __imag x.val != a[1]) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr39829.c b/gcc/testsuite/gcc.dg/torture/pr39829.c new file mode 100644 index 00000000000..da15a56e106 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr39829.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-w" } */ + +void foo (void * DAG_temp117584) +{ + char uA; + void* pA; + void* pB; + void* pC; + do { + int DAG_temp117585; + int DAG_temp117586; + void ** __indir_union1 = (void**)DAG_temp117584; + DAG_temp117585 = (long)*__indir_union1; + DAG_temp117586 = DAG_temp117585; + if ( DAG_temp117586 != (int)268435456 ) + pA = (void*)&uA; + pB = (void*)&pA; + pC = pB; + union __block_indir0_u { struct { long val; } __indir_struct; } + * __indir_union = (union __block_indir0_u*)pC; + f(__indir_union->__indir_struct.val); + + DAG_temp117584 += 64; + } while (1); +} + diff --git a/gcc/testsuite/gcc.dg/torture/pr39855.c b/gcc/testsuite/gcc.dg/torture/pr39855.c new file mode 100644 index 00000000000..6d75c38a907 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr39855.c @@ -0,0 +1,24 @@ +/* PR c/39855 */ +/* { dg-do run { target { int32plus } } } */ + +extern void abort (void); + +int i, j, k; + +int +foo (void) +{ + return ++i; +} + +int +main () +{ + if (__CHAR_BIT__ != 8 || sizeof (int) != 4) + return 0; + j = foo () << 30 << 2; + k = (unsigned) foo () >> 16 >> 16; + if (i != 2 || j != 0 || k != 0) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c b/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c index b57715efcb0..d32a6cedc7a 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c +++ b/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c @@ -16,6 +16,7 @@ main() /* { dg-final-use { scan-tree-dump "Single value 4 stringop" "tree_profile"} } */ /* Really this ought to simplify into assignment, but we are not there yet. */ /* a[0] = b[0] is what we fold the resulting memcpy into. */ -/* { dg-final-use { scan-tree-dump "a.0. = b.0." "optimized"} } */ +/* { dg-final-use { scan-tree-dump "a.0. = " "optimized"} } */ +/* { dg-final-use { scan-tree-dump "= b.0." "optimized"} } */ /* { dg-final-use { cleanup-tree-dump "optimized" } } */ /* { dg-final-use { cleanup-tree-dump "tree_profile" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c b/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c index 3e7bd542e7a..e6b49999d33 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c +++ b/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c @@ -14,7 +14,7 @@ main() return 0; } /* { dg-final-use { scan-tree-dump "Single value 4 stringop" "tree_profile"} } */ -/* Really this ought to simplify into assignment, but we are not there yet. */ -/* { dg-final-use { scan-tree-dump "memset.*4\\)" "optimized"} } */ +/* The versioned memset of size 4 should be optimized to an assignment. */ +/* { dg-final-use { scan-tree-dump "a\\\[0\\\] = 168430090" "optimized"} } */ /* { dg-final-use { cleanup-tree-dump "optimized" } } */ /* { dg-final-use { cleanup-tree-dump "tree_profile" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c index dfe994ffef9..4d9cb1b9969 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c @@ -16,7 +16,7 @@ main () return 0; } /* { dg-final-use { scan-tree-dump "Div.mod by constant n=257 transformation on insn" "tree_profile"} } */ -/* { dg-final-use { scan-tree-dump "if \\(n != 257\\)" "optimized"} } */ +/* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* != 257\\)" "optimized"} } */ /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ /* { dg-final-use { cleanup-tree-dump "optimized" } } */ /* { dg-final-use { cleanup-tree-dump "tree_profile" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c index 66b0614c5ef..30a92c0157f 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c @@ -26,7 +26,7 @@ main () /* { dg-final-use { scan-tree-dump "Mod power of 2 transformation on insn" "tree_profile"} } */ /* This is part of code checking that n is power of 2, so we are sure that the transformation didn't get optimized out. */ -/* { dg-final-use { scan-tree-dump "n \\+ 0xffff" "optimized"} } */ +/* { dg-final-use { scan-tree-dump "n_\[0-9\]* \\+ 0xffff" "optimized"} } */ /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ /* { dg-final-use { cleanup-tree-dump "optimized" } } */ /* { dg-final-use { cleanup-tree-dump "tree_profile" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c index f233d670cc2..ad32a44b32d 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c @@ -26,7 +26,7 @@ main () /* { dg-final-use { scan-tree-dump "Mod subtract transformation on insn" "tree_profile"} } */ /* This is part of code checking that n is greater than the divisor so we are sure that it didn't get optimized out. */ -/* { dg-final-use { scan-tree-dump "if \\(n \\>" "optimized"} } */ +/* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* \\>" "optimized"} } */ /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ /* { dg-final-use { cleanup-tree-dump "optimized" } } */ /* { dg-final-use { cleanup-tree-dump "tree_profile" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c index 86418e05e3a..fdc2b0c6d65 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c @@ -26,7 +26,7 @@ main () /* { dg-final-use { scan-tree-dump "Mod subtract transformation on insn" "tree_profile"} } */ /* This is part of code checking that n is greater than the divisor so we are sure that it didn't get optimized out. */ -/* { dg-final-use { scan-tree-dump "if \\(n \\>" "optimized"} } */ +/* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* \\>" "optimized"} } */ /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ /* { dg-final-use { cleanup-tree-dump "optimized" } } */ /* { dg-final-use { cleanup-tree-dump "tree_profile" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c index 1ad2c63653c..f884736a1c9 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -fdump-rtl-expand-details" } */ union tree_node; @@ -42,6 +42,6 @@ objects_must_conflict_p (t1, t2) } /* There should be two assignments of variables to the value zero. */ -/* { dg-final { scan-tree-dump-times " = 0" 2 "final_cleanup"} } */ +/* { dg-final { scan-rtl-dump-times "PART.. = 0" 2 "expand"} } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-rtl-dump "expand" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030824-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030824-1.c index da1389e916c..e5988bd7998 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030824-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030824-1.c @@ -19,5 +19,5 @@ int foo (int x, int y) } /* The addition should be optimized into 'y+x'. */ -/* { dg-final { scan-tree-dump-times "\[xy\] \\+ \[xy]" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "\[xy\]_..D. \\+ \[xy]_..D." 1 "optimized"} } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030824-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030824-2.c index 1b8bc48147f..1234aeb34d1 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030824-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030824-2.c @@ -19,5 +19,5 @@ int foo (int x, int y) } /* This function should be optimized into 'return y+x'. */ -/* { dg-final { scan-tree-dump-times "return \[xy\] \\+ \[xy\]" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "\[xy\]_..D. \\+ \[xy]_..D." 1 "optimized"} } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-11.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-11.c index cccc512cbe1..d4ce34bd8cb 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/alias-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-11.c @@ -14,6 +14,8 @@ int bar(void) return a[0] + *p.a; } -/* { dg-final { scan-tree-dump "return \\*p\\.a \\\+ a.0.;" "optimized" } } */ +/* We need to have both: a load from "a[0]" and a load from "*p.a", + the latter can be an ssa temporary. */ +/* { dg-final { scan-tree-dump "= a.0.;" "optimized" } } */ +/* { dg-final { scan-tree-dump "= \\*\[pD\]" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ - diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-6.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-6.c index 460dd11cd48..bcc011898fa 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/alias-6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-6.c @@ -14,6 +14,8 @@ int bar(void) return a[0] + *p.a; } -/* { dg-final { scan-tree-dump "return \\*p\\.a \\\+ a.0.;" "optimized" } } */ +/* We need to have both: a load from "a[0]" and a load from "*p.a", + the latter can be an ssa temporary. */ +/* { dg-final { scan-tree-dump "= a.0.;" "optimized" } } */ +/* { dg-final { scan-tree-dump "= \\*\[pD\]" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ - diff --git a/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c b/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c index fdcddb7a5fa..e35d179c547 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c @@ -27,6 +27,6 @@ void test(void) /* { dg-final { scan-tree-dump-times "hardreg" 3 "optimized" } } */ /* In particular, hardreg should *not* appear in the call to bar. */ -/* { dg-final { scan-tree-dump-times "bar \[(\]t\[)\]" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "bar \[(\]t_.\[)\]" 1 "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/cswtch-2.c b/gcc/testsuite/gcc.dg/tree-ssa/cswtch-2.c new file mode 100644 index 00000000000..ec1d28fe329 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/cswtch-2.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-switchconv" } */ + +typedef enum { a = 5, b = 6, c = 7, d = 8, e = 9 } X; + +int h1 (X x) +{ + switch (x) { + case a: + case b: + case c: + case d: + case e: + return 1; + default: + return 0; + } +} + +/* { dg-final { scan-tree-dump-times "CSWTCH" 0 "switchconv" } } */ +/* { dg-final { cleanup-tree-dump "switchconv" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/divide-1.c b/gcc/testsuite/gcc.dg/tree-ssa/divide-1.c index fdd3f44e040..66bc3745bcc 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/divide-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/divide-1.c @@ -7,8 +7,8 @@ int f(int a) } -/* { dg-final { scan-tree-dump-times "-a / 10" 0 "optimized"} } */ -/* { dg-final { scan-tree-dump-times "a / -10" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "-a" 0 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "a_..D. / -10" 1 "optimized"} } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/divide-3.c b/gcc/testsuite/gcc.dg/tree-ssa/divide-3.c index d305b549cbd..12fa09b9536 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/divide-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/divide-3.c @@ -6,8 +6,8 @@ int f(int a) return -(a/10); } -/* { dg-final { scan-tree-dump-times "a / 10" 0 "optimized"} } */ -/* { dg-final { scan-tree-dump-times "a / -10" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "a_\[0-9()D\]* / 10" 0 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "a_..D. / -10" 1 "optimized"} } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/divide-4.c b/gcc/testsuite/gcc.dg/tree-ssa/divide-4.c index b1bb1efa9e1..734acad69a7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/divide-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/divide-4.c @@ -6,8 +6,8 @@ int f(int a) return -(-a/10); } -/* { dg-final { scan-tree-dump-times "-a / 10" 0 "optimized"} } */ -/* { dg-final { scan-tree-dump-times "a / 10" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "-a" 0 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "a_..D. / 10" 1 "optimized"} } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c index 4469fe7312e..cc583e293f8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-final_cleanup -fdump-tree-fre -W -Wall -fno-early-inlining" } */ +/* { dg-options "-O1 -fdump-tree-optimized -fdump-tree-fre -W -Wall -fno-early-inlining" } */ int b; unsigned a; @@ -15,7 +15,7 @@ void f(void) /* We should have converted the assignments to two = 1. FRE does this. */ -/* { dg-final { scan-tree-dump-times " = 1" 2 "final_cleanup"} } */ +/* { dg-final { scan-tree-dump-times " = 1" 2 "optimized"} } */ /* { dg-final { scan-tree-dump-not " = a;" "fre"} } */ /* { dg-final { cleanup-tree-dump "fre" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-1.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-1.c index 7b9e3be499a..030181404d1 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/inline-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ typedef struct { @@ -20,6 +20,6 @@ interval foo (interval a, interval b, interval c) } -/* { dg-final { scan-tree-dump-times "\\(struct interval\\)" 0 "final_cleanup"} } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "\\(struct interval\\)" 0 "optimized"} } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c index ad0995d262c..aa0747b6e7e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c @@ -20,7 +20,7 @@ int bla(void) /* Since the loop is removed, there should be no addition. */ /* { dg-final { scan-tree-dump-times "\\+" 0 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "n \\* n" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "n_. \\* n_." 1 "optimized" } } */ /* The if from the loop header copying remains in the code. */ /* { dg-final { scan-tree-dump-times "if " 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c index cae91bac4ba..9ec893298a1 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c @@ -6,7 +6,7 @@ /* { dg-do compile { target { i?86-*-* || { x86_64-*-* || powerpc_hard_double } } } } */ /* { dg-require-effective-target nonpic } */ -/* { dg-options "-O3 -fdump-tree-final_cleanup" } */ +/* { dg-options "-O3 -fdump-tree-optimized" } */ # define N 2000000 static double a[N],c[N]; @@ -22,7 +22,7 @@ void tuned_STREAM_Copy() However, due to a bug in jump threading, we end up peeling one iteration from the loop, which creates an additional occurence. */ -/* { dg-final { scan-tree-dump-times "MEM.(base: &|symbol: )a," 2 "final_cleanup" } } */ -/* { dg-final { scan-tree-dump-times "MEM.(base: &|symbol: )c," 2 "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "MEM.(base: &|symbol: )a," 2 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "MEM.(base: &|symbol: )c," 2 "optimized" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-21.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-21.c index 59a17cb5e7f..f53407d9b02 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-21.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-21.c @@ -1,7 +1,7 @@ /* PR tree-optimization/30322 */ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ extern void op( int, int); void foo(int f0, int f1, int e0, int e1) @@ -13,5 +13,5 @@ void foo(int f0, int f1, int e0, int e1) op(i0, i1); } -/* { dg-final { scan-tree-dump-times "~" 0 "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "~" 0 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-22.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-22.c index be8cdcc77d4..fa7da712b6a 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-22.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-22.c @@ -1,4 +1,4 @@ -/* { dg-options "-O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ int a[100]; @@ -13,5 +13,5 @@ void test (int n) /* We used to replace the exit test "i < n" by "i != ((n-1)/3) * 3 + 1". Although correct, this transformation is obviously harmful. */ -/* { dg-final { scan-tree-dump-times "/" 0 "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "/" 0 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-28.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-28.c index 19f0ac5c184..77d0c47dc95 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-28.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-28.c @@ -1,6 +1,6 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { dg-require-effective-target ilp32 } */ -/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -fdump-tree-final_cleanup -fdump-tree-aprefetch --param max-unrolled-insns=1000" } */ +/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -fdump-tree-optimized -fdump-tree-aprefetch --param max-unrolled-insns=1000" } */ char x[100000]; @@ -15,10 +15,10 @@ void foo(int n) /* There should be 64 MEMs in the unrolled loop and one more in the copy of the loop for the rest of the iterations. */ -/* { dg-final { scan-tree-dump-times "MEM" 65 "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "MEM" 65 "optimized" } } */ /* There should be no i_a = i_b assignments. */ /* { dg-final { scan-tree-dump-times "i_.*= i_\[0-9\]*;" 0 "aprefetch" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ /* { dg-final { cleanup-tree-dump "aprefetch" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c index f0ba475c798..a8db74afe14 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c @@ -19,7 +19,9 @@ void xxx(void) /* Only iter variable should remain. */ /* { dg-final { scan-tree-dump-times "int iter" 1 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "jter" 0 "optimized" } } */ + +/* And jter shouldn't be an induction variable anymore (no PHI node). */ +/* { dg-final { scan-tree-dump-times "jter_\[0-9\]* = PHI" 0 "optimized" } } */ /* And the use of jter should be replaced by iter + 2 */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c index d126313feed..783d598a0ed 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c @@ -17,7 +17,7 @@ return 0; /* Everything should have been cleaned up leaving a simple return statement. */ -/* { dg-final { scan-tree-dump-times "return.*a != 0" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "= a_..D. != 0" 1 "optimized" } } */ /* There should not be any abnormal edges as DOM removed the computed gotos. */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr19431.c b/gcc/testsuite/gcc.dg/tree-ssa/pr19431.c index 4334648ce64..1c87acbddda 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr19431.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr19431.c @@ -24,6 +24,6 @@ int f(int k, int i1, int j1) return *f1; } -/* { dg-final { scan-tree-dump "i1 = j1" "optimized" } } */ -/* { dg-final { scan-tree-dump "return i1;" "optimized" } } */ +/* { dg-final { scan-tree-dump "i1_. = PHI <i1_\[^,\]*, j1_\[^>\]*>" "optimized" } } */ +/* { dg-final { scan-tree-dump "return i1_.;" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr20139.c b/gcc/testsuite/gcc.dg/tree-ssa/pr20139.c index 054e4b2081c..016ad004ee8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr20139.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr20139.c @@ -3,7 +3,7 @@ that the optimization happens at tree level. */ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ extern double fabs (double); extern void link_error (void); @@ -19,5 +19,5 @@ foo (double x) link_error (); } -/* { dg-final { scan-tree-dump-times "link_error" 0 "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr22051-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr22051-1.c index 4815be0ac9e..73bda118fe5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr22051-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr22051-1.c @@ -17,7 +17,7 @@ foo() /* The cast to a function pointer type must remain after all optimizations are complete so that function pointer canonicalization works on those targets which require it. */ -/* { dg-final { scan-tree-dump-times "if \\(\\(void \\(\\*<.*>\\) \\(void\\)\\) p" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "= \\(void \\(\\*<.*>\\) \\(void\\)\\) p_" 1 "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr22051-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr22051-2.c index a6b7099d634..bcbbb73c659 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr22051-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr22051-2.c @@ -20,6 +20,6 @@ foo() /* The cast to an int type must remain after all optimizations are complete so that we do not try to canonicalize a function pointer for the comparison when no such canonicalization is wanted. */ -/* { dg-final { scan-tree-dump-times "if \\(\\(int\\).*q" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "r_. = \\(int\\) q" 1 "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr23294.c b/gcc/testsuite/gcc.dg/tree-ssa/pr23294.c index d73512d7af5..ed890fa5514 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr23294.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr23294.c @@ -31,7 +31,7 @@ int f6(int a, int b) return 6*a - 2*b; } -/* { dg-final { scan-tree-dump-times "a \\\* 5" 3 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "\\\) \\\* 2" 3 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "a_..D. \\\* 5" 3 "optimized" } } */ +/* { dg-final { scan-tree-dump-times " \\\* 2" 3 "optimized" } } */ /* { dg-final { scan-tree-dump-not "\\\* 6" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c b/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c index 5444e2d197c..3329383cbe8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c @@ -10,5 +10,5 @@ int foo(int a) return e; } -/* { dg-final { scan-tree-dump "return a > 0;" "optimized" } } */ +/* { dg-final { scan-tree-dump "e_. = a_..D. > 0;" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c b/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c index 0c1a58206f4..940a0362943 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-empty -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -fdump-tree-empty -fdump-tree-optimized" } */ int foo (int n) { @@ -48,8 +48,8 @@ int baz (int n) /* There should be no division/modulo in the final dump (division and modulo by 64 are done using bit operations). */ -/* { dg-final { scan-tree-dump-times "/" 0 "final_cleanup" } } */ -/* { dg-final { scan-tree-dump-times "%" 0 "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "/" 0 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "%" 0 "optimized" } } */ /* { dg-final { cleanup-tree-dump "empty" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-4.c b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-4.c index 8a5230eedd3..bff4b9fbf12 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-4.c @@ -2,7 +2,7 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { dg-require-effective-target ilp32 } */ -/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -fdump-tree-optimized" } */ int xxx[20]; @@ -14,5 +14,5 @@ void foo (int n) xxx[i] = i; } -/* { dg-final { scan-tree-dump-times "prefetch" 0 "final_cleanup" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "prefetch" 0 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c index 510dee04598..3024bed1b71 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c @@ -1,6 +1,6 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { dg-require-effective-target ilp32 } */ -/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 --param max-unrolled-insns=1 -fdump-tree-aprefetch-details -fdump-tree-final_cleanup" } */ +/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 --param max-unrolled-insns=1 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */ #define K 1000000 int a[K], b[K]; @@ -45,9 +45,9 @@ void test(int *p) /* { dg-final { scan-tree-dump-times "Issued nontemporal prefetch" 3 "aprefetch" } } */ /* { dg-final { scan-tree-dump-times "nontemporal store" 2 "aprefetch" } } */ -/* { dg-final { scan-tree-dump-times "builtin_prefetch" 8 "final_cleanup" } } */ -/* { dg-final { scan-tree-dump-times "=\\{nt\\}" 2 "final_cleanup" } } */ -/* { dg-final { scan-tree-dump-times "__builtin_ia32_mfence" 2 "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-times "builtin_prefetch" 8 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "=\\{nt\\}" 2 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_ia32_mfence" 2 "optimized" } } */ /* { dg-final { scan-assembler-times "prefetchw" 5 } } */ /* { dg-final { scan-assembler-times "prefetcht" 1 } } */ @@ -56,4 +56,4 @@ void test(int *p) /* { dg-final { scan-assembler-times "mfence" 2 } } */ /* { dg-final { cleanup-tree-dump "aprefetch" } } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-1.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-1.c index 166780adf87..ea5e4a77b11 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-1.c @@ -14,5 +14,6 @@ int main(void) printf ("%d %d\n", e, f); } -/* { dg-final { scan-tree-dump-times "b \\\+ a" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "b.._. \\\+ a.._." 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times " \\\+ " 2 "optimized"} } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c b/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c index fe6dde4bb19..2cf245460ee 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c @@ -20,7 +20,7 @@ void tst(void) blau ((unsigned char) i); /* This one is necessary. */ } -/* { dg-final { scan-tree-dump-times "\\(int\\) \\(unsigned char\\)" 1 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "\\(int\\) \\(char\\)" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "= \\(unsigned char\\)" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "= \\(char\\)" 1 "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-25.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-25.c new file mode 100644 index 00000000000..f29c4942ace --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-25.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-ccp1 -fdump-tree-forwprop1" } */ + +int a[256]; +int foo(int i) +{ + int *p = &a[0]; + return *(p + i); +} + +/* { dg-final { scan-tree-dump "&a\\\[\[iD\]\\\." "ccp1" } } */ +/* { dg-final { scan-tree-dump "= a\\\[\[iD\]\\\." "forwprop1" } } */ +/* { dg-final { cleanup-tree-dump "ccp1" } } */ +/* { dg-final { cleanup-tree-dump "forwprop1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-26.c new file mode 100644 index 00000000000..542c4293960 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-26.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-forwprop1" } */ + +int a[256]; +int foo(int i) +{ + return (a + 1)[i]; +} + +/* { dg-final { scan-tree-dump "= a\\\[D\\\." "forwprop1" } } */ +/* { dg-final { cleanup-tree-dump "forwprop1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c index 518fda854e6..ed3b2f7840f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fdump-rtl-expand-details" } */ /* Verify we PRE the strlen call, as strlen("") folds to zero. */ @@ -12,5 +12,5 @@ __SIZE_TYPE__ mystrlen (const char *s) return strlen(s); } -/* { dg-final { scan-tree-dump "= 0;" "optimized" } } */ -/* { dg-final { cleanup-tree-dump "optimized" } } */ +/* { dg-final { scan-rtl-dump "PART.. = 0" "expand" } } */ +/* { dg-final { cleanup-rtl-dump "expand" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vector-2.c b/gcc/testsuite/gcc.dg/tree-ssa/vector-2.c index 2ce438899a5..cb680937a2f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vector-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vector-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-w -O1 -fdump-tree-final_cleanup" } */ +/* { dg-options "-w -O1 -fdump-tree-optimized" } */ #define vector __attribute__(( vector_size(16) )) @@ -16,7 +16,7 @@ float f(vector float a, int b, vector float c) } /* We should be able to optimize this to just "return 0.0;" */ -/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 0 "final_cleanup"} } */ -/* { dg-final { scan-tree-dump-times "0.0" 1 "final_cleanup"} } */ +/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 0 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "0.0" 1 "optimized"} } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vector-3.c b/gcc/testsuite/gcc.dg/tree-ssa/vector-3.c index 332e127ddcc..15a700c658e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vector-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vector-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-w -O1 -fdump-tree-final_cleanup" } */ +/* { dg-options "-w -O1 -fdump-tree-optimized" } */ #define vector __attribute((vector_size(16) )) vector float a; @@ -13,8 +13,8 @@ float f(float b) } /* We should be able to optimize this to just "return 0.0;" */ -/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 0 "final_cleanup"} } */ -/* { dg-final { scan-tree-dump-times "0.0" 1 "final_cleanup"} } */ +/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 0 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "0.0" 1 "optimized"} } */ -/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp48.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp48.c new file mode 100644 index 00000000000..a4234659917 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp48.c @@ -0,0 +1,23 @@ +/* { dg-do link } */ +/* { dg-options "-O2" } */ + +extern void link_failure (void); + +static int __attribute__ ((noinline)) foo (int x) +{ + if (x >= 1) + if (x <= 10) + { + if (x < 1 || x > 10) + link_failure (); + x = x + 1; + } + return x; +} + +int main (void) +{ + int i = foo (0); + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c b/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c new file mode 100644 index 00000000000..7d6af7b82f3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ + +#define N 128 + +int out[N*4], out2[N], in[N*4]; + +void +foo () +{ + int i, a0, a1, a2, a3; + + for (i = 0; i < N; i++) + { + a0 = in[i*4]; + a1 = in[i*4 + 1]; + a2 = in[i*4 + 2]; + a3 = in[i*4 + 3]; + + out[i*4] = a0; + out[i*4 + 1] = a1; + out[i*4 + 2] = a2; + out[i*4 + 3] = a3; + + out2[i] = a0; + } +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided_wide } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided_wide } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c index d9bb114d416..cd7bb01a50d 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c @@ -76,5 +76,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target vect_no_align } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target vect_no_align } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c index b7ef4b43017..69f79bf8823 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c @@ -1,6 +1,7 @@ /* { dg-require-effective-target vect_float } */ #include <stdarg.h> +#include <string.h> #include "tree-vect.h" #define N 256 @@ -20,6 +21,15 @@ void bar (float *pa, float *pb, float *pc) return; } +__attribute__ ((noinline)) +void foo (float *pb, float *pc) +{ + float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; + float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; + memcpy (pb, b, sizeof (b)); + memcpy (pc, c, sizeof (c)); +} + /* Unaligned pointer read accesses with known alignment, and an unaligned write access with unknown alignment. The loop bound is known and divisible by the vectorization factor. @@ -33,11 +43,13 @@ __attribute__ ((noinline)) int main1 (float *pa) { int i; - float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; - float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; + float b[N] __attribute__ ((__aligned__(16))); + float c[N] __attribute__ ((__aligned__(16))); float *pb = b; float *pc = c; + foo (pb, pc); + for (i = 0; i < N/2; i++) { pa[i] = pb[i+1] * pc[i+1]; @@ -59,5 +71,5 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c index 39491a882e5..47b268e148b 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c @@ -2,6 +2,7 @@ /* { dg-require-effective-target vect_float } */ #include <stdarg.h> +#include <string.h> #include "tree-vect.h" #define N 256 @@ -21,6 +22,15 @@ void bar (float *pa, float *pb, float *pc) return; } +__attribute__ ((noinline)) +void foo (float *pb, float *pc) +{ + float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; + float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; + memcpy (pb, b, sizeof (b)); + memcpy (pc, c, sizeof (c)); +} + /* Unaligned pointer read accesses with known alignment, and an unaligned write access with unknown alignment. The loop bound is iunknown. @@ -34,11 +44,13 @@ __attribute__ ((noinline)) int main1 (int n , float *pa) { int i; - float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; - float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; + float b[N] __attribute__ ((__aligned__(16))); + float c[N] __attribute__ ((__aligned__(16))); float *pb = b; float *pc = c; + foo (pb, pc); + for (i = 0; i < n/2; i++) { pa[i] = pb[i+1] * pc[i+1]; @@ -61,5 +73,5 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-54.c b/gcc/testsuite/gcc.dg/vect/vect-54.c index 6e1aa549a97..a44cdd41811 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-54.c +++ b/gcc/testsuite/gcc.dg/vect/vect-54.c @@ -26,13 +26,14 @@ void bar (float *pa, float *pb, float *pc) vect-58.c is similar to this one with one difference: the loop bound is unknown. */ +float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; +float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; + __attribute__ ((noinline)) int main1 () { int i; float a[N] __attribute__ ((__aligned__(16))); - float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; - float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; float *pa = a; float *pb = b; float *pc = c; diff --git a/gcc/testsuite/gcc.dg/vect/vect-56.c b/gcc/testsuite/gcc.dg/vect/vect-56.c index 387bd3ab854..624a11287ea 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-56.c +++ b/gcc/testsuite/gcc.dg/vect/vect-56.c @@ -30,13 +30,14 @@ void bar (float *pa, float *pb, float *pc) vect-57.c is similar to this one with two differences: aliasing is a problem, and the write access has unknown alignment. */ +float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; +float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; + __attribute__ ((noinline)) int main1 () { int i; float a[N] __attribute__ ((__aligned__(16))); - float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; - float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; float *pa = a; float *pb = b; float *pc = c; diff --git a/gcc/testsuite/gcc.dg/vect/vect-58.c b/gcc/testsuite/gcc.dg/vect/vect-58.c index 94cc3efa468..fe58860e000 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-58.c +++ b/gcc/testsuite/gcc.dg/vect/vect-58.c @@ -26,11 +26,12 @@ void bar (float *pa, float *pb, float *pc) vect-54.c is similar to this one with one difference: the loop bound is known. */ +float a[N] __attribute__ ((__aligned__(16))); float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; + __attribute__ ((noinline)) int main1 (int n) { int i; - float a[N] __attribute__ ((__aligned__(16))); float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; float *pa = a; float *pb = b; float *pc = c; diff --git a/gcc/testsuite/gcc.dg/vect/vect-60.c b/gcc/testsuite/gcc.dg/vect/vect-60.c index 97e614c0652..efb1d5043c4 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-60.c +++ b/gcc/testsuite/gcc.dg/vect/vect-60.c @@ -30,13 +30,14 @@ void bar (float *pa, float *pb, float *pc) vect-61.c is similar to this one with two differences: aliasing is not a problem, and the write access has unknown alignment. */ +float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; +float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; + __attribute__ ((noinline)) int main1 (int n) { int i; float a[N] __attribute__ ((__aligned__(16))); - float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; - float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; float *pa = a; float *pb = b; float *pc = c; diff --git a/gcc/testsuite/gcc.dg/vector-init-1.c b/gcc/testsuite/gcc.dg/vector-init-1.c new file mode 100644 index 00000000000..5baf9568840 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vector-init-1.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ + +/* PR C/31499, test that the C front-end treats vectors like an array. */ + +#define vector __attribute__((__vector_size__(4*sizeof(int)) )) +vector signed int v1[]={0,1,2,3,4,5,6,7}; diff --git a/gcc/testsuite/gcc.dg/vector-init-2.c b/gcc/testsuite/gcc.dg/vector-init-2.c new file mode 100644 index 00000000000..6527f495d81 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vector-init-2.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ + +/* PR C/31499, test that the C front-end treats vectors like an array + and that it works at runtime. */ + +#define vector __attribute__((__vector_size__(4*sizeof(int)) )) +vector signed int v1[]={0,1,2,3,4,5,6,7}; + + +int main(void) +{ + int i; + for (i = 0; i < sizeof(v1)/sizeof(v1[0]); i++) + { + vector int t = v1[i]; + int *d = (int*)&t; + int j; + for (j = 0; j < 4; j++) + { + if (d[j] != i * 4 + j) + __builtin_abort (); + } + } + return 0; +}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/vla-19.c b/gcc/testsuite/gcc.dg/vla-19.c new file mode 100644 index 00000000000..83093c9291a --- /dev/null +++ b/gcc/testsuite/gcc.dg/vla-19.c @@ -0,0 +1,32 @@ +/* Test diagnostics for variably modified function return types. PR + 39564. */ +/* { dg-do compile } */ +/* { dg-options "-std=c99" } */ + +int a; + +void +f1 (void) +{ + typedef int T[a]; + extern T *g1 (void); /* { dg-error "non-nested function with variably modified type" } */ +} + +void +f2 (void) +{ + extern int (*g2 (void))[a]; /* { dg-error "non-nested function with variably modified type" } */ +} + +void +f3 (void) +{ + typedef int T[a]; + T *g3 (void); /* { dg-error "non-nested function with variably modified type" } */ +} + +void +f4 (void) +{ + int (*g4 (void))[a]; /* { dg-error "non-nested function with variably modified type" } */ +} diff --git a/gcc/testsuite/gcc.dg/vla-20.c b/gcc/testsuite/gcc.dg/vla-20.c new file mode 100644 index 00000000000..04d9ee753a3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vla-20.c @@ -0,0 +1,12 @@ +/* Test use of sizeof with [*] in type name: should not refer to + zero-size array. PR 39582. */ +/* { dg-do compile } */ +/* { dg-options "-std=c99 -pedantic-errors" } */ + +void foo11d(int x[sizeof(int *[*])]); /* { dg-warning "not in a declaration" } */ + +/* Although the size is not constant, it may nevertheless appear in a + constant expression if not evaluated. */ + +void foo11e(int x[1 ? 0 : sizeof(int *[*])]); /* { dg-warning "not in a declaration" } */ +/* { dg-error "zero-size array" "correct zero size" { target *-*-* } 11 } */ diff --git a/gcc/testsuite/gcc.dg/vla-21.c b/gcc/testsuite/gcc.dg/vla-21.c new file mode 100644 index 00000000000..a39ae0b4266 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vla-21.c @@ -0,0 +1,7 @@ +/* Type names for VLAs should be allowed outside functions if the size + is not evaluated. PR 39581. */ +/* { dg-do compile } */ +/* { dg-options "-std=c99 -pedantic-errors" } */ + +int a; +int b = sizeof (int (*)[a]); diff --git a/gcc/testsuite/gcc.dg/vmx/3a-04.c b/gcc/testsuite/gcc.dg/vmx/3a-04.c index f6657084cc5..a04497bede9 100644 --- a/gcc/testsuite/gcc.dg/vmx/3a-04.c +++ b/gcc/testsuite/gcc.dg/vmx/3a-04.c @@ -10,9 +10,13 @@ f(vector float a, vector float b, vector float c) static void test() { - check(vec_all_eq(f(((vector float){2,3,5,7}), + check(vec_all_gt(f(((vector float){2,3,5,7}), ((vector float){11,13,17,19}), ((vector float){23,29,31,37})), - ((vector float){23.1818085, 29.2307587, 32.2940826, 128.368393})), + ((vector float){23.18, 29.23, 32.29, 128.36})) + && vec_all_lt(f(((vector float){2,3,5,7}), + ((vector float){11,13,17,19}), + ((vector float){23,29,31,37})), + ((vector float){23.19, 29.24, 32.30, 128.37})), "f"); } diff --git a/gcc/testsuite/gcc.dg/vmx/3a-04m.c b/gcc/testsuite/gcc.dg/vmx/3a-04m.c index e394e9b8bd9..b6e273bcc9f 100644 --- a/gcc/testsuite/gcc.dg/vmx/3a-04m.c +++ b/gcc/testsuite/gcc.dg/vmx/3a-04m.c @@ -10,9 +10,13 @@ f(vector float a, vector float b, vector float c) static void test() { - check(vec_all_eq(f(((vector float){2,3,5,7}), + check(vec_all_gt(f(((vector float){2,3,5,7}), ((vector float){11,13,17,19}), ((vector float){23,29,31,37})), - ((vector float){23.1818085, 29.2307587, 32.2940826, 128.368393})), + ((vector float){23.18, 29.23, 32.29, 128.36})) + && vec_all_lt(f(((vector float){2,3,5,7}), + ((vector float){11,13,17,19}), + ((vector float){23,29,31,37})), + ((vector float){23.19, 29.24, 32.30, 128.37})), "f"); } diff --git a/gcc/testsuite/gcc.dg/vmx/3a-05.c b/gcc/testsuite/gcc.dg/vmx/3a-05.c index 55e0ed8e0c2..8d6ba5eab41 100644 --- a/gcc/testsuite/gcc.dg/vmx/3a-05.c +++ b/gcc/testsuite/gcc.dg/vmx/3a-05.c @@ -14,9 +14,13 @@ f(vector float a, vector float b, vector float c) static void test() { - check(vec_all_eq(f(((vector float){2,3,5,7}), + check(vec_all_gt(f(((vector float){2,3,5,7}), ((vector float){11,13,17,19}), ((vector float){23,29,31,37})), - ((vector float){16.9092026, 18.7693329, -2.8233242, -92.9472198})), - "f"); + ((vector float){16.90, 18.76, -2.83, -92.95})) + && vec_all_lt(f(((vector float){2,3,5,7}), + ((vector float){11,13,17,19}), + ((vector float){23,29,31,37})), + ((vector float){16.91, 18.77, -2.82, -92.94})), + "f"); } diff --git a/gcc/testsuite/gcc.dg/wtr-int-type-1.c b/gcc/testsuite/gcc.dg/wtr-int-type-1.c index d44165d90b9..c0abb44055e 100644 --- a/gcc/testsuite/gcc.dg/wtr-int-type-1.c +++ b/gcc/testsuite/gcc.dg/wtr-int-type-1.c @@ -25,9 +25,17 @@ testfunc () /* But this one should, since it doesn't fit in long (long), but does fit in unsigned long (long). */ - i = 18446744073709551615; /* { dg-warning "decimal constant|unsigned" "decimal constant" } */ - + i = 18446744073709551615; /* { dg-warning "integer constant is so large that it is unsigned" "decimal constant" } */ + /* { dg-warning "this decimal constant would be unsigned in ISO C90" "decimal constant" { target *-*-* } 28 } */ + # 29 "sys-header.h" 3 +} + +void +testfunc2( ) +{ + long long i; + /* We are in system headers now, no -Wtraditional warnings should issue. */ i = 0x80000000; @@ -41,3 +49,4 @@ testfunc () i = 9223372036854775807; i = 18446744073709551615; } + |