2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / target-attribute / tattr-arch-tune-1.c
blobded08854a98ad8f7c1c8453d8665e1fc234cee58
1 /* Functional tests for the "target" attribute and pragma. */
3 /* { dg-require-effective-target target_attribute } */
4 /* { dg-options "-mdebug -march=z13" } */
6 /**
7 ** no pragma
8 **/
10 void fn_p0_1 (void) { }
11 /* { dg-final { scan-assembler "fn:fn_p0_1 ar9" } } */
12 /* { dg-final { scan-assembler "fn:fn_p0_1 tu9" } } */
14 __attribute__ ((target("arch=zEC12")))
15 void fn_p0_2 (void) { }
16 /* { dg-final { scan-assembler "fn:fn_p0_2 ar8" } } */
17 /* { dg-final { scan-assembler "fn:fn_p0_2 tu8" } } */
19 __attribute__ ((target("tune=z196")))
20 void fn_p0_3 (void) { }
21 /* { dg-final { scan-assembler "fn:fn_p0_3 ar9" } } */
22 /* { dg-final { scan-assembler "fn:fn_p0_3 tu7" } } */
24 __attribute__ ((target("arch=zEC12,tune=z196")))
25 void fn_p0_4 (void) { }
26 /* { dg-final { scan-assembler "fn:fn_p0_4 ar8" } } */
27 /* { dg-final { scan-assembler "fn:fn_p0_4 tu7" } } */
29 __attribute__ ((target("tune=z196,arch=zEC12")))
30 void fn_p0_5 (void) { }
31 /* { dg-final { scan-assembler "fn:fn_p0_5 ar8" } } */
32 /* { dg-final { scan-assembler "fn:fn_p0_5 tu7" } } */
34 /**
35 ** arch pragma
36 **/
38 #pragma GCC target ("arch=z9-ec")
40 void fn_pa_1 (void) { }
41 /* { dg-final { scan-assembler "fn:fn_pa_1 ar5" } } */
42 /* { dg-final { scan-assembler "fn:fn_pa_1 tu5" } } */
44 __attribute__ ((target("arch=zEC12")))
45 void fn_pa_2 (void) { }
46 /* { dg-final { scan-assembler "fn:fn_pa_2 ar8" } } */
47 /* { dg-final { scan-assembler "fn:fn_pa_2 tu8" } } */
49 __attribute__ ((target("tune=z196")))
50 void fn_pa_3 (void) { }
51 /* { dg-final { scan-assembler "fn:fn_pa_3 ar5" } } */
52 /* { dg-final { scan-assembler "fn:fn_pa_3 tu7" } } */
54 __attribute__ ((target("arch=zEC12,tune=z196")))
55 void fn_pa_4 (void) { }
56 /* { dg-final { scan-assembler "fn:fn_pa_4 ar8" } } */
57 /* { dg-final { scan-assembler "fn:fn_pa_4 tu7" } } */
59 __attribute__ ((target("tune=z196,arch=zEC12")))
60 void fn_pa_5 (void) { }
61 /* { dg-final { scan-assembler "fn:fn_pa_5 ar8" } } */
62 /* { dg-final { scan-assembler "fn:fn_pa_5 tu7" } } */
64 #pragma GCC reset_options
66 /**
67 ** tune pragma
68 **/
70 #pragma GCC target ("tune=z9-109")
72 void fn_pt_1 (void) { }
73 /* { dg-final { scan-assembler "fn:fn_pt_1 ar9" } } */
74 /* { dg-final { scan-assembler "fn:fn_pt_1 tu4" } } */
76 __attribute__ ((target("arch=zEC12")))
77 void fn_pt_2 (void) { }
78 /* { dg-final { scan-assembler "fn:fn_pt_2 ar8" } } */
79 /* { dg-final { scan-assembler "fn:fn_pt_2 tu4" } } */
81 __attribute__ ((target("tune=z196")))
82 void fn_pt_3 (void) { }
83 /* { dg-final { scan-assembler "fn:fn_pt_3 ar9" } } */
84 /* { dg-final { scan-assembler "fn:fn_pt_3 tu7" } } */
86 __attribute__ ((target("arch=zEC12,tune=z196")))
87 void fn_pt_4 (void) { }
88 /* { dg-final { scan-assembler "fn:fn_pt_4 ar8" } } */
89 /* { dg-final { scan-assembler "fn:fn_pt_4 tu7" } } */
91 __attribute__ ((target("tune=z196,arch=zEC12")))
92 void fn_pt_5 (void) { }
93 /* { dg-final { scan-assembler "fn:fn_pt_5 ar8" } } */
94 /* { dg-final { scan-assembler "fn:fn_pt_5 tu7" } } */
96 #pragma GCC reset_options
98 /**
99 ** arch and tune pragmas
102 #pragma GCC target ("arch=z9-ec,tune=z9-109")
104 void fn_pat_1 (void) { }
105 /* { dg-final { scan-assembler "fn:fn_pat_1 ar5" } } */
106 /* { dg-final { scan-assembler "fn:fn_pat_1 tu4" } } */
108 __attribute__ ((target("arch=zEC12")))
109 void fn_pat_2 (void) { }
110 /* { dg-final { scan-assembler "fn:fn_pat_2 ar8" } } */
111 /* { dg-final { scan-assembler "fn:fn_pat_2 tu4" } } */
113 __attribute__ ((target("tune=z196")))
114 void fn_pat_3 (void) { }
115 /* { dg-final { scan-assembler "fn:fn_pat_3 ar5" } } */
116 /* { dg-final { scan-assembler "fn:fn_pat_3 tu7" } } */
118 __attribute__ ((target("arch=zEC12,tune=z196")))
119 void fn_pat_4 (void) { }
120 /* { dg-final { scan-assembler "fn:fn_pat_4 ar8" } } */
121 /* { dg-final { scan-assembler "fn:fn_pat_4 tu7" } } */
123 __attribute__ ((target("tune=z196,arch=zEC12")))
124 void fn_pat_5 (void) { }
125 /* { dg-final { scan-assembler "fn:fn_pat_5 ar8" } } */
126 /* { dg-final { scan-assembler "fn:fn_pat_5 tu7" } } */
128 #pragma GCC reset_options
131 ** tune and arch pragmas
134 #pragma GCC target ("tune=z9-109,arch=z9-ec")
136 void fn_pta_1 (void) { }
137 /* { dg-final { scan-assembler "fn:fn_pta_1 ar5" } } */
138 /* { dg-final { scan-assembler "fn:fn_pta_1 tu4" } } */
140 __attribute__ ((target("arch=zEC12")))
141 void fn_pta_2 (void) { }
142 /* { dg-final { scan-assembler "fn:fn_pta_2 ar8" } } */
143 /* { dg-final { scan-assembler "fn:fn_pta_2 tu4" } } */
145 __attribute__ ((target("tune=z196")))
146 void fn_pta_3 (void) { }
147 /* { dg-final { scan-assembler "fn:fn_pta_3 ar5" } } */
148 /* { dg-final { scan-assembler "fn:fn_pta_3 tu7" } } */
150 __attribute__ ((target("arch=zEC12,tune=z196")))
151 void fn_pta_4 (void) { }
152 /* { dg-final { scan-assembler "fn:fn_pta_4 ar8" } } */
153 /* { dg-final { scan-assembler "fn:fn_pta_4 tu7" } } */
155 __attribute__ ((target("tune=z196,arch=zEC12")))
156 void fn_pta_5 (void) { }
157 /* { dg-final { scan-assembler "fn:fn_pta_5 ar8" } } */
158 /* { dg-final { scan-assembler "fn:fn_pta_5 tu7" } } */
160 #pragma GCC reset_options