1 /// Check default CC1 and linker options for ppc32.
2 // RUN: %clang -### -target powerpc-unknown-linux-gnu %s 2>&1 | FileCheck --check-prefix=PPC32 %s
3 // PPC32: "-mfloat-abi" "hard"
4 
5 // PPC32: "-m" "elf32ppclinux"
6 
7 // check -msoft-float option for ppc32
8 // RUN: %clang -target powerpc-unknown-linux-gnu %s -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTFLOAT %s
9 // CHECK-SOFTFLOAT: "-target-feature" "-hard-float"
10 
11 // check -mfloat-abi=soft option for ppc32
12 // RUN: %clang -target powerpc-unknown-linux-gnu %s -mfloat-abi=soft -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABISOFT %s
13 // CHECK-FLOATABISOFT: "-target-feature" "-hard-float"
14 
15 // check -mhard-float option for ppc32
16 // RUN: %clang -target powerpc-unknown-linux-gnu %s -mhard-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-HARDFLOAT %s
17 // CHECK-HARDFLOAT-NOT: "-target-feature" "-hard-float"
18 
19 // check -mfloat-abi=hard option for ppc32
20 // RUN: %clang -target powerpc-unknown-linux-gnu %s -mfloat-abi=hard -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABIHARD %s
21 // CHECK-FLOATABIHARD-NOT: "-target-feature" "-hard-float"
22 
23 // check combine -mhard-float -msoft-float option for ppc32
24 // RUN: %clang -target powerpc-unknown-linux-gnu %s -mhard-float -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-HARDSOFT %s
25 // CHECK-HARDSOFT: "-target-feature" "-hard-float"
26 
27 // check combine -msoft-float -mhard-float option for ppc32
28 // RUN: %clang -target powerpc-unknown-linux-gnu %s -msoft-float -mhard-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTHARD %s
29 // CHECK-SOFTHARD-NOT: "-target-feature" "-hard-float"
30 
31 // check -msecure-plt option for ppc32
32 // RUN: %clang -target powerpc-unknown-linux-gnu -msecure-plt %s  -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SECUREPLT %s
33 // CHECK-SECUREPLT: "-target-feature" "+secure-plt"
34 
35 // check -mfloat-abi=x option
36 // RUN: %clang -target powerpc-unknown-linux-gnu %s -mfloat-abi=x -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ERRMSG %s
37 // CHECK-ERRMSG: error: invalid float ABI '-mfloat-abi=x'
38 
39 
40 /// Check default CC1 and linker options for ppc64.
41 // RUN: %clang -### -target powerpc64le-unknown-linux-gnu %s 2>&1 | FileCheck --check-prefix=PPC64 %s
42 // RUN: %clang -### -target powerpc64-unknown-linux-gnu %s 2>&1 | FileCheck -check-prefix=PPC64BE %s
43 // PPC64: "-mfloat-abi" "hard"
44 
45 // PPC64: "-m" "elf64lppc"
46 // PPC64BE: "-m" "elf64ppc"
47 
48 // check -msoft-float option for ppc64
49 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTFLOAT64 %s
50 // CHECK-SOFTFLOAT64: "-target-feature" "-hard-float"
51 
52 // check -mfloat-abi=soft option for ppc64
53 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mfloat-abi=soft -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABISOFT64 %s
54 // CHECK-FLOATABISOFT64: "-target-feature" "-hard-float"
55 
56 // check -msoft-float option for ppc64
57 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTFLOAT64le %s
58 // CHECK-SOFTFLOAT64le: "-target-feature" "-hard-float"
59 
60 // check -mfloat-abi=soft option for ppc64
61 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -mfloat-abi=soft -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABISOFT64le %s
62 // CHECK-FLOATABISOFT64le: "-target-feature" "-hard-float"
63 
64 // Check that -mno-altivec correctly disables the altivec target feature on powerpc.
65 
66 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -maltivec -### -o %t.o 2>&1 | FileCheck --check-prefix=ALTIVEC %s
67 // ALTIVEC: "-target-feature" "+altivec"
68 
69 // RUN: %clang -### -c -target powerpc64-unknown-linux-gnu %s -maltivec -mno-altivec 2>&1 | FileCheck --check-prefix=NO_ALTIVEC %s
70 // NO_ALTIVEC: "-target-feature" "-altivec"
71 
72 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-mfcrf -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOMFCRF %s
73 // CHECK-NOMFCRF: "-target-feature" "-mfocrf"
74 
75 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-mfcrf -mmfcrf -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-MFCRF %s
76 // CHECK-MFCRF: "-target-feature" "+mfocrf"
77 
78 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-isel -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOISEL %s
79 // CHECK-NOISEL: "-target-feature" "-isel"
80 
81 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-isel -misel -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-ISEL %s
82 // CHECK-ISEL: "-target-feature" "+isel"
83 
84 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-popcntd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOPOPCNTD %s
85 // CHECK-NOPOPCNTD: "-target-feature" "-popcntd"
86 
87 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-popcntd -mpopcntd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-POPCNTD %s
88 // CHECK-POPCNTD: "-target-feature" "+popcntd"
89 
90 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-fprnd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOFPRND %s
91 // CHECK-NOFPRND: "-target-feature" "-fprnd"
92 
93 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-fprnd -mfprnd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-FPRND %s
94 // CHECK-FPRND: "-target-feature" "+fprnd"
95 
96 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-cmpb -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCMPB %s
97 // CHECK-NOCMPB: "-target-feature" "-cmpb"
98 
99 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-cmpb -mcmpb -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CMPB %s
100 // CHECK-CMPB: "-target-feature" "+cmpb"
101 
102 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOVSX %s
103 // CHECK-NOVSX: "-target-feature" "-vsx"
104 
105 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -mvsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-VSX %s
106 // CHECK-VSX: "-target-feature" "+vsx"
107 
108 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-htm -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOHTM %s
109 // CHECK-NOHTM: "-target-feature" "-htm"
110 
111 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-htm -mhtm -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-HTM %s
112 // CHECK-HTM: "-target-feature" "+htm"
113 
114 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOP8VECTOR %s
115 // CHECK-NOP8VECTOR: "-target-feature" "-power8-vector"
116 
117 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -mpower8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-P8VECTOR %s
118 // CHECK-P8VECTOR: "-target-feature" "+power8-vector"
119 
120 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power10-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOP10VECTOR %s
121 // CHECK-NOP10VECTOR: "-target-feature" "-power10-vector"
122 
123 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power10-vector -mpower10-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-P10VECTOR %s
124 // CHECK-P10VECTOR: "-target-feature" "+power10-vector"
125 
126 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
127 // CHECK-NOCRBITS: "-target-feature" "-crbits"
128 
129 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -mcrbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
130 // CHECK-CRBITS: "-target-feature" "+crbits"
131 
132 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-longcall -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOLONGCALL %s
133 // CHECK-NOLONGCALL: "-target-feature" "-longcall"
134 
135 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-longcall -mlongcall -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-LONGCALL %s
136 // CHECK-LONGCALL: "-target-feature" "+longcall"
137 
138 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-invariant-function-descriptors -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOINVFUNCDESC %s
139 // CHECK-NOINVFUNCDESC: "-target-feature" "-invariant-function-descriptors"
140 
141 // 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
142 // CHECK-INVFUNCDESC: "-target-feature" "+invariant-function-descriptors"
143 
144 // RUN: %clang -target powerpc %s -mno-spe -mspe -c -### 2>&1 | FileCheck -check-prefix=CHECK-SPE %s
145 // RUN: %clang -target powerpcspe %s -c -### 2>&1 | FileCheck -check-prefix=CHECK-SPE %s
146 // RUN: %clang -target powerpcspe %s -mno-spe -c -### 2>&1 | FileCheck -check-prefix=CHECK-NOSPE %s
147 // CHECK-SPE: "-target-feature" "+spe"
148 // CHECK-NOSPE: "-target-feature" "-spe"
149 
150 // Assembler features
151 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_BE_AS_ARGS %s
152 // CHECK_BE_AS_ARGS: "-mppc64"
153 // CHECK_BE_AS_ARGS: "-many"
154 
155 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_LE_AS_ARGS %s
156 // CHECK_LE_AS_ARGS: "-mppc64"
157 // CHECK_LE_AS_ARGS: "-mlittle-endian"
158 // CHECK_LE_AS_ARGS: "-mpower8"
159 
160 // OpenMP features
161 // RUN: %clang -target powerpc-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
162 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
163 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
164 // CHECK_OPENMP_TLS-NOT: "-fnoopenmp-use-tls"
165