]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/tree-ssa/pr43491.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 #define REGISTER register
7 # define REG1 asm("r4")
9 # define REG1 asm("ebx")
10 #elif defined __mips__
11 # define REG1 asm("s0")
12 #elif defined __x86_64__
13 # define REG1 asm("rbp")
20 REGISTER
long data_0 REG1
;
23 long foo(long data
, long v
)
39 /* We should not eliminate global register variable when it is the RHS of
40 a single assignment. So the number of loads from data_0 has to match
41 that of the number of adds (we hoist data_0 + data_3 above the
42 if (data) and eliminate the useless copy). */
44 /* { dg-final { scan-tree-dump-times "= data_0;" 1 "optimized" { target { arm*-*-* i?86-*-* mips*-*-* x86_64-*-* } } } } */
45 /* { dg-final { scan-tree-dump-times " \\+ " 1 "optimized" { target { ! { arm*-*-* i?86-*-* mips*-*-* x86_64-*-* } } } } } */