diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c | 18 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr51505.c | 19 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr51106-1.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr51106-2.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c | 21 |
6 files changed, 94 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c b/gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c new file mode 100644 index 00000000000..dd578907da0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c @@ -0,0 +1,8 @@ +/* { dg-lto-options {{-flto}} } */ +/* { dg-lto-do link } */ + +/* Test that we can build one object file with -fgnu-tm + (trans-mem-3_1.c), but do the final link of all objects without + -fgnu-tm. */ + +int i; diff --git a/gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c b/gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c new file mode 100644 index 00000000000..d907f68384f --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c @@ -0,0 +1,18 @@ +/* { dg-options "-fgnu-tm" } */ + +extern int i; + +main() +{ + __transaction_atomic { i = 0; } +} + +#define dummy(func) \ + __attribute__((noinline,noclone,used)) void func() { asm (""); } + +dummy(_ITM_beginTransaction) +dummy(_ITM_commitTransaction) +dummy(_ITM_WU4) +dummy(_ITM_WU8) +dummy(_ITM_registerTMCloneTable) +dummy(_ITM_deregisterTMCloneTable) diff --git a/gcc/testsuite/gcc.dg/pr51505.c b/gcc/testsuite/gcc.dg/pr51505.c new file mode 100644 index 00000000000..dbcd3226d7d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr51505.c @@ -0,0 +1,19 @@ +/* PR rtl-optimization/51505 */ +/* { dg-do compile } */ +/* { dg-options "-O --param max-cse-insns=1" } */ +struct S +{ +char a[256]; +}; + +int bar(struct S, char[16]); + +void foo () +{ + struct S u, s1, s2; + char e[256]; + char i; + e[i] = ~s1.a[i] & s2.a[i]; + if (bar(u, e)) + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr51106-1.c b/gcc/testsuite/gcc.dg/torture/pr51106-1.c new file mode 100644 index 00000000000..10b3b682b98 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr51106-1.c @@ -0,0 +1,14 @@ +/* PR target/51106 */ +/* { dg-do "compile" } */ +/* { dg-skip-if "RTL error" { "*-*-*" } { "-fno-fat-lto-objects" } { "" } } */ + +int +foo (int x) +{ + asm goto ("" : : "i" (x) : : lab); /* { dg-error "impossible constraint" } */ + return 1; +lab: + return 0; +} + +/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } 8 } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr51106-2.c b/gcc/testsuite/gcc.dg/torture/pr51106-2.c new file mode 100644 index 00000000000..e69bf1b01ab --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr51106-2.c @@ -0,0 +1,14 @@ +/* PR target/51106 */ +/* { dg-do "compile" } */ +/* { dg-skip-if "RTL error" { "*-*-*" } { "-fno-fat-lto-objects" } { "" } } */ + +int +bar (int x) +{ + asm goto ("" : : "i" (x) : : lab); /* { dg-error "impossible constraint" } */ + __builtin_unreachable (); +lab: + return 0; +} + +/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } 8 } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c new file mode 100644 index 00000000000..3c27a1a29f5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c @@ -0,0 +1,21 @@ +/* PR37997 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-pre-details" } */ + +int foo (int i, int b, int result) +{ + int mask; + if (b) + mask = -1; + else + mask = 0; + result = i + 1; + result = result & mask; + return result; +} + +/* We should insert i + 1 into the if (b) path as well as the simplified + i + 1 & -1 expression. And do replacement with two PHI temps. */ + +/* { dg-final { scan-tree-dump-times "with prephitmp" 2 "pre" } } */ +/* { dg-final { cleanup-tree-dump "pre" } } */ |