annotate gcc/testsuite/gcc.dg/tree-ssa/asm-3.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR 17739 */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 #ifdef __hppa__
kono
parents:
diff changeset
6 #define REGISTER "1"
kono
parents:
diff changeset
7 #else
kono
parents:
diff changeset
8 #ifdef __moxie__
kono
parents:
diff changeset
9 #define REGISTER "8"
kono
parents:
diff changeset
10 #else
kono
parents:
diff changeset
11 #define REGISTER "0"
kono
parents:
diff changeset
12 #endif
kono
parents:
diff changeset
13 #endif
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 void foo (int);
kono
parents:
diff changeset
16 void bar (int);
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 static inline int source(void)
kono
parents:
diff changeset
19 {
kono
parents:
diff changeset
20 register int hardreg __asm__(REGISTER);
kono
parents:
diff changeset
21 asm("" : "=r"(hardreg));
kono
parents:
diff changeset
22 return hardreg;
kono
parents:
diff changeset
23 }
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 void test(void)
kono
parents:
diff changeset
26 {
kono
parents:
diff changeset
27 int t = source();
kono
parents:
diff changeset
28 foo(t);
kono
parents:
diff changeset
29 bar(t);
kono
parents:
diff changeset
30 }
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 /* Hardreg should appear exactly 3 times -- declaration, asm stmt,
kono
parents:
diff changeset
33 and copy out. */
kono
parents:
diff changeset
34 /* { dg-final { scan-tree-dump-times "hardreg" 3 "optimized" } } */
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 /* In particular, hardreg should *not* appear in the call to bar. */
kono
parents:
diff changeset
37 /* { dg-final { scan-tree-dump-times "bar \[(\]\[^\n\r\]*_.\[)\]" 1 "optimized" } } */
kono
parents:
diff changeset
38