Debian Codegraph @

gcc/testsuite/gcc.target/s390/target-attribute/tattr-15.c

raw
1 /* Functional tests for the "target" attribute and pragma. */
2
3 /* { dg-do compile } */
4 /* { dg-require-effective-target target_attribute } */
5 /* { dg-options "-mno-packed-stack" } */
6
7 extern void foo(void);
8
9 #pragma GCC target("packed-stack")
10 int p1(void)
11 {
12 foo();
13 return 1;
14 }
15 #pragma GCC reset_options
16
17 #pragma GCC target("no-packed-stack")
18 int p0(void)
19 {
20 foo();
21 return 2;
22 }
23 int p0b(void)
24 {
25 foo();
26 return 2;
27 }
28 #pragma GCC reset_options
29
30 __attribute__ ((target("packed-stack")))
31 int a1(void)
32 {
33 foo();
34 return 4;
35 }
36
37 __attribute__ ((target("packed-stack")))
38 int a1b(void)
39 {
40 foo();
41 return 4;
42 }
43
44 __attribute__ ((target("packed-stack")))
45 int a1c(void)
46 {
47 foo();
48 return 4;
49 }
50
51 __attribute__ ((target("packed-stack")))
52 int a1d(void)
53 {
54 foo();
55 return 4;
56 }
57
58 __attribute__ ((target("no-packed-stack")))
59 int a0(void)
60 {
61 foo();
62 return 8;
63 }
64
65 __attribute__ ((target("no-packed-stack")))
66 int a0b(void)
67 {
68 foo();
69 return 8;
70 }
71
72 __attribute__ ((target("no-packed-stack")))
73 int a0c(void)
74 {
75 foo();
76 return 8;
77 }
78
79 __attribute__ ((target("no-packed-stack")))
80 int a0d(void)
81 {
82 foo();
83 return 8;
84 }
85
86 __attribute__ ((target("no-packed-stack")))
87 int a0e(void)
88 {
89 foo();
90 return 8;
91 }
92
93 __attribute__ ((target("no-packed-stack")))
94 int a0f(void)
95 {
96 foo();
97 return 8;
98 }
99
100 __attribute__ ((target("no-packed-stack")))
101 int a0g(void)
102 {
103 foo();
104 return 8;
105 }
106
107 __attribute__ ((target("no-packed-stack")))
108 int a0h(void)
109 {
110 foo();
111 return 8;
112 }
113
114 /* { dg-final { scan-assembler-times "\t.cfi_offset 15, -40" 10 { target { lp64 } } } } */
115 /* { dg-final { scan-assembler-times "\t.cfi_offset 15, -8" 5 { target { lp64 } } } } */
116 /* { dg-final { scan-assembler-times "\t.cfi_offset 15, -36" 10 { target { ! lp64 } } } } */
117 /* { dg-final { scan-assembler-times "\t.cfi_offset 15, -4" 5 { target { ! lp64 } } } } */