testsuite: skip zero-scratch-regs on powerpc.
[official-gcc.git] / gcc / testsuite / c-c++-common / zero-scratch-regs-10.c
blob193db8c3a30d4b9d1f41122e4098ebaaf05fb56d
1 /* { dg-do run } */
2 /* { dg-skip-if "not implemented" { powerpc*-*-* } } */
3 /* { dg-options "-O2" } */
5 #include <assert.h>
6 int result = 0;
8 int
9 __attribute__((noipa))
10 __attribute__ ((zero_call_used_regs("skip")))
11 foo1 (int x)
13 return (x + 1);
16 int
17 __attribute__((noipa))
18 __attribute__ ((zero_call_used_regs("used-gpr-arg")))
19 foo2 (int x)
21 return (x + 2);
24 int
25 __attribute__((noipa))
26 __attribute__ ((zero_call_used_regs("used-gpr")))
27 foo3 (int x)
29 return (x + 3);
32 int
33 __attribute__((noipa))
34 __attribute__ ((zero_call_used_regs("used-arg")))
35 foo4 (int x)
37 return (x + 4);
40 int
41 __attribute__((noipa))
42 __attribute__ ((zero_call_used_regs("used")))
43 foo5 (int x)
45 return (x + 5);
48 int
49 __attribute__((noipa))
50 __attribute__ ((zero_call_used_regs("all-gpr-arg")))
51 foo6 (int x)
53 return (x + 6);
56 int
57 __attribute__((noipa))
58 __attribute__ ((zero_call_used_regs("all-gpr")))
59 foo7 (int x)
61 return (x + 7);
64 int
65 __attribute__((noipa))
66 __attribute__ ((zero_call_used_regs("all-arg")))
67 foo8 (int x)
69 return (x + 8);
72 int
73 __attribute__((noipa))
74 __attribute__ ((zero_call_used_regs("all")))
75 foo9 (int x)
77 return (x + 9);
80 int main()
82 result = foo1 (1);
83 result += foo2 (1);
84 result += foo3 (1);
85 result += foo4 (1);
86 result += foo5 (1);
87 result += foo6 (1);
88 result += foo7 (1);
89 result += foo8 (1);
90 result += foo9 (1);
91 assert (result == 54);
92 return 0;