1 // check -msoft-float option for ppc32
2 // RUN: %clang -target powerpc-unknown-linux-gnu %s -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTFLOAT %s
3 // CHECK-SOFTFLOAT: "-target-feature" "-hard-float"
5 // check -mfloat-abi=soft option for ppc32
6 // RUN: %clang -target powerpc-unknown-linux-gnu %s -mfloat-abi=soft -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABISOFT %s
7 // CHECK-FLOATABISOFT: "-target-feature" "-hard-float"
9 // check -mhard-float option for ppc32
10 // RUN: %clang -target powerpc-unknown-linux-gnu %s -mhard-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-HARDFLOAT %s
11 // CHECK-HARDFLOAT-NOT: "-target-feature" "-hard-float"
13 // check -mfloat-abi=hard option for ppc32
14 // RUN: %clang -target powerpc-unknown-linux-gnu %s -mfloat-abi=hard -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABIHARD %s
15 // CHECK-FLOATABIHARD-NOT: "-target-feature" "-hard-float"
17 // check combine -mhard-float -msoft-float option for ppc32
18 // RUN: %clang -target powerpc-unknown-linux-gnu %s -mhard-float -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-HARDSOFT %s
19 // CHECK-HARDSOFT: "-target-feature" "-hard-float"
21 // check combine -msoft-float -mhard-float option for ppc32
22 // RUN: %clang -target powerpc-unknown-linux-gnu %s -msoft-float -mhard-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTHARD %s
23 // CHECK-SOFTHARD-NOT: "-target-feature" "-hard-float"
25 // check -mfloat-abi=x option
26 // RUN: %clang -target powerpc-unknown-linux-gnu %s -mfloat-abi=x -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ERRMSG %s
27 // CHECK-ERRMSG: error: invalid float ABI '-mfloat-abi=x'
29 // check -msoft-float option for ppc64
30 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTFLOAT64 %s
31 // CHECK-SOFTFLOAT64: "-target-feature" "-hard-float"
33 // check -mfloat-abi=soft option for ppc64
34 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mfloat-abi=soft -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABISOFT64 %s
35 // CHECK-FLOATABISOFT64: "-target-feature" "-hard-float"
37 // check -msoft-float option for ppc64
38 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTFLOAT64le %s
39 // CHECK-SOFTFLOAT64le: "-target-feature" "-hard-float"
41 // check -mfloat-abi=soft option for ppc64
42 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -mfloat-abi=soft -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABISOFT64le %s
43 // CHECK-FLOATABISOFT64le: "-target-feature" "-hard-float"
45 // Check that -mno-altivec correctly disables the altivec target feature on powerpc.
47 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-1 %s
48 // CHECK-1: "-target-feature" "-altivec"
50 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-2 %s
51 // CHECK-2: "-target-feature" "-altivec"
53 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -maltivec -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-3 %s
54 // CHECK-3: "-target-feature" "-altivec"
56 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -maltivec -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-4 %s
57 // CHECK-4: "-target-feature" "-altivec"
59 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -maltivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-5 %s
60 // CHECK-5-NOT: "-target-feature" "-altivec"
62 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -maltivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-6 %s
63 // CHECK-6-NOT: "-target-feature" "-altivec"
65 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=7400 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-7 %s
66 // CHECK-7: "-target-feature" "-altivec"
68 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=g4 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-8 %s
69 // CHECK-8: "-target-feature" "-altivec"
71 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=7450 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-9 %s
72 // CHECK-9: "-target-feature" "-altivec"
74 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=g4+ -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-10 %s
75 // CHECK-10: "-target-feature" "-altivec"
77 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=970 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-11 %s
78 // CHECK-11: "-target-feature" "-altivec"
80 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=g5 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-12 %s
81 // CHECK-12: "-target-feature" "-altivec"
83 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=pwr6 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-13 %s
84 // CHECK-13: "-target-feature" "-altivec"
86 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=pwr7 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-14 %s
87 // CHECK-14: "-target-feature" "-altivec"
89 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=pwr8 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-15 %s
90 // CHECK-15: "-target-feature" "-altivec"
92 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=ppc64 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-16 %s
93 // CHECK-16: "-target-feature" "-altivec"
95 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-qpx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOQPX %s
96 // CHECK-NOQPX: "-target-feature" "-qpx"
98 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-qpx -mqpx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-QPX %s
99 // CHECK-QPX-NOT: "-target-feature" "-qpx"
101 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-mfcrf -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOMFCRF %s
102 // CHECK-NOMFCRF: "-target-feature" "-mfocrf"
104 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-mfcrf -mmfcrf -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-MFCRF %s
105 // CHECK-MFCRF: "-target-feature" "+mfocrf"
107 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-isel -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOISEL %s
108 // CHECK-NOISEL: "-target-feature" "-isel"
110 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-isel -misel -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-ISEL %s
111 // CHECK-ISEL: "-target-feature" "+isel"
113 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-popcntd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOPOPCNTD %s
114 // CHECK-NOPOPCNTD: "-target-feature" "-popcntd"
116 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-popcntd -mpopcntd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-POPCNTD %s
117 // CHECK-POPCNTD: "-target-feature" "+popcntd"
119 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-fprnd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOFPRND %s
120 // CHECK-NOFPRND: "-target-feature" "-fprnd"
122 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-fprnd -mfprnd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-FPRND %s
123 // CHECK-FPRND: "-target-feature" "+fprnd"
125 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-cmpb -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCMPB %s
126 // CHECK-NOCMPB: "-target-feature" "-cmpb"
128 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-cmpb -mcmpb -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CMPB %s
129 // CHECK-CMPB: "-target-feature" "+cmpb"
131 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOVSX %s
132 // CHECK-NOVSX: "-target-feature" "-vsx"
134 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -mvsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-VSX %s
135 // CHECK-VSX: "-target-feature" "+vsx"
137 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-htm -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOHTM %s
138 // CHECK-NOHTM: "-target-feature" "-htm"
140 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-htm -mhtm -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-HTM %s
141 // CHECK-HTM: "-target-feature" "+htm"
143 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOP8VECTOR %s
144 // CHECK-NOP8VECTOR: "-target-feature" "-power8-vector"
146 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -mpower8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-P8VECTOR %s
147 // CHECK-P8VECTOR: "-target-feature" "+power8-vector"
149 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
150 // CHECK-NOCRBITS: "-target-feature" "-crbits"
152 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -mcrbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
153 // CHECK-CRBITS: "-target-feature" "+crbits"
155 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-longcall -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOLONGCALL %s
156 // CHECK-NOLONGCALL: "-target-feature" "-longcall"
158 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-longcall -mlongcall -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-LONGCALL %s
159 // CHECK-LONGCALL: "-target-feature" "+longcall"
161 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-invariant-function-descriptors -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOINVFUNCDESC %s
162 // CHECK-NOINVFUNCDESC: "-target-feature" "-invariant-function-descriptors"
164 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-invariant-function-descriptors -minvariant-function-descriptors -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-INVFUNCDESC %s
165 // CHECK-INVFUNCDESC: "-target-feature" "+invariant-function-descriptors"
167 // Assembler features
168 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_BE_AS_ARGS %s
169 // CHECK_BE_AS_ARGS: "-mppc64"
170 // CHECK_BE_AS_ARGS: "-many"
172 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_LE_AS_ARGS %s
173 // CHECK_LE_AS_ARGS: "-mppc64"
174 // CHECK_LE_AS_ARGS: "-many"
175 // CHECK_LE_AS_ARGS: "-mlittle-endian"
178 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_BE_LD_ARGS %s
179 // CHECK_BE_LD_ARGS: "elf64ppc"
181 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_LE_LD_ARGS %s
182 // CHECK_LE_LD_ARGS: "elf64lppc"
185 // RUN: %clang -target powerpc-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
186 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
187 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
188 // CHECK_OPENMP_TLS-NOT: "-fnoopenmp-use-tls"