diff options
author | Jan Hubicka <jh@suse.cz> | 2020-09-26 10:44:53 +0200 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2020-09-26 10:44:53 +0200 |
commit | a8d2d89de2ef6b87166acc81589bdbb622917705 (patch) | |
tree | 60e368e04fcf2cf4ac2bc09df4688a1642b01f1c | |
parent | ada353b87909fd6cd37a30083b4fdcb76acbf5fe (diff) | |
download | gcc-a8d2d89de2ef6b87166acc81589bdbb622917705.zip gcc-a8d2d89de2ef6b87166acc81589bdbb622917705.tar.gz gcc-a8d2d89de2ef6b87166acc81589bdbb622917705.tar.bz2 |
Add modref testcases
gcc/testsuite/
* gcc.dg/lto/modref-1_0.c: New test.
* gcc.dg/lto/modref-1_1.c: New test.
* gcc.dg/tree-ssa/modref-2.c: New test.
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/modref-1_0.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/modref-1_1.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/modref-2.c | 26 |
3 files changed, 53 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/lto/modref-1_0.c b/gcc/testsuite/gcc.dg/lto/modref-1_0.c new file mode 100644 index 0000000..8fcb9ec --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/modref-1_0.c @@ -0,0 +1,14 @@ +/* { dg-lto-do run } */ +/* { dg-lto-options {"-O2 -flto-partition=max -flto"} } */ +extern void recursive (int *a, int *b, int *c, int level); +int +main() +{ + int x = 123, y=124, z=125; + recursive (&x,&y,&z,1); + if (y) + __builtin_abort (); + if (!__builtin_constant_p (z)) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/lto/modref-1_1.c b/gcc/testsuite/gcc.dg/lto/modref-1_1.c new file mode 100644 index 0000000..c7c0eae --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/modref-1_1.c @@ -0,0 +1,13 @@ +short aa; +void +__attribute__ ((noinline, noclone)) +recursive (int *a, int *b, int *c, int level) +{ + if (level && c) + { + recursive (b,a,c,0); + aa++; + } + else + *a=0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/modref-2.c b/gcc/testsuite/gcc.dg/tree-ssa/modref-2.c new file mode 100644 index 0000000..9999d37 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/modref-2.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ +short aa; +void +__attribute__ ((noinline, noclone)) +recursive (int *a, int *b, int *c, int level) +{ + if (level && c) + { + recursive (b,a,c,0); + aa++; + } + else + *a=0; +} +int +main() +{ + int x = 123, y=124, z=125; + recursive (&x,&y,&z,1); + if (y) + __builtin_abort (); + if (!__builtin_constant_p (z)) + __builtin_abort (); + return 0; +} |