Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / asm-3.c
blob9fbfc701511a712793b21dbc35cb1b3f0afa431c
1 /* PR 17739 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
5 #ifdef __hppa__
6 #define REGISTER "1"
7 #else
8 #define REGISTER "0"
9 #endif
11 static inline int source(void)
13 register int hardreg __asm__(REGISTER);
14 asm("" : "=r"(hardreg));
15 return hardreg;
18 void test(void)
20 int t = source();
21 foo(t);
22 bar(t);
25 /* Hardreg should appear exactly 3 times -- declaration, asm stmt,
26 and copy out. */
27 /* { dg-final { scan-tree-dump-times "hardreg" 3 "optimized" } } */
29 /* In particular, hardreg should *not* appear in the call to bar. */
30 /* { dg-final { scan-tree-dump-times "bar \[(\]t\[)\]" 1 "optimized" } } */