Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/asm-3.c

raw
1 /* PR 17739 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
4
5 #ifdef __hppa__
6 #define REGISTER "1"
7 #else
8 #ifdef __moxie__
9 #define REGISTER "8"
10 #else
11 #ifdef __iq2000__
12 #define REGISTER "3"
13 #else
14 #define REGISTER "0"
15 #endif
16 #endif
17 #endif
18
19 void foo (int);
20 void bar (int);
21
22 static inline int source(void)
23 {
24 register int hardreg __asm__(REGISTER);
25 asm("" : "=r"(hardreg));
26 return hardreg;
27 }
28
29 void test(void)
30 {
31 int t = source();
32 foo(t);
33 bar(t);
34 }
35
36 /* Hardreg should appear exactly 3 times -- declaration, asm stmt,
37 and copy out. */
38 /* { dg-final { scan-tree-dump-times "hardreg" 3 "optimized" } } */
39
40 /* In particular, hardreg should *not* appear in the call to bar. */
41 /* { dg-final { scan-tree-dump-times "bar \[(\]\[^\n\r\]*_.\[)\]" 1 "optimized" } } */
42