blob: 1cb6cee061c1dc7ae425005ed1d1d4ed407e4874 [file] [log] [blame]
Petar Jovanovic88a328f2015-12-14 17:51:50 +00001// 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
Hal Finkel415c2a32016-10-02 02:10:45 +00003// CHECK-SOFTFLOAT: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +00004
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
Hal Finkel415c2a32016-10-02 02:10:45 +00007// CHECK-FLOATABISOFT: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +00008
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
Hal Finkel415c2a32016-10-02 02:10:45 +000011// CHECK-HARDFLOAT-NOT: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000012
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
Hal Finkel415c2a32016-10-02 02:10:45 +000015// CHECK-FLOATABIHARD-NOT: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000016
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
Hal Finkel415c2a32016-10-02 02:10:45 +000019// CHECK-HARDSOFT: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000020
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
Hal Finkel415c2a32016-10-02 02:10:45 +000023// CHECK-SOFTHARD-NOT: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000024
Strahinja Petrovic269a6e72018-04-11 12:24:44 +000025// check -msecure-plt option for ppc32
26// RUN: %clang -target powerpc-unknown-linux-gnu -msecure-plt %s -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SECUREPLT %s
27// CHECK-SECUREPLT: "-target-feature" "+secure-plt"
28
Petar Jovanovic88a328f2015-12-14 17:51:50 +000029// check -mfloat-abi=x option
30// RUN: %clang -target powerpc-unknown-linux-gnu %s -mfloat-abi=x -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ERRMSG %s
Petar Jovanovic59a981a2015-12-14 19:22:35 +000031// CHECK-ERRMSG: error: invalid float ABI '-mfloat-abi=x'
Petar Jovanovic88a328f2015-12-14 17:51:50 +000032
33// check -msoft-float option for ppc64
34// RUN: %clang -target powerpc64-unknown-linux-gnu %s -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTFLOAT64 %s
Hal Finkel415c2a32016-10-02 02:10:45 +000035// CHECK-SOFTFLOAT64: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000036
37// check -mfloat-abi=soft option for ppc64
38// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mfloat-abi=soft -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABISOFT64 %s
Hal Finkel415c2a32016-10-02 02:10:45 +000039// CHECK-FLOATABISOFT64: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000040
41// check -msoft-float option for ppc64
42// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTFLOAT64le %s
Hal Finkel415c2a32016-10-02 02:10:45 +000043// CHECK-SOFTFLOAT64le: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000044
45// check -mfloat-abi=soft option for ppc64
46// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -mfloat-abi=soft -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABISOFT64le %s
Hal Finkel415c2a32016-10-02 02:10:45 +000047// CHECK-FLOATABISOFT64le: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000048
Eric Christopher758aad72017-03-21 22:06:18 +000049// Check that -mno-altivec correctly disables the altivec target feature on powerpc.
Bill Schmidt102bb322013-02-01 14:45:29 +000050
Eric Christopher758aad72017-03-21 22:06:18 +000051// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-1 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000052// CHECK-1: "-target-feature" "-altivec"
53
54// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-2 %s
55// CHECK-2: "-target-feature" "-altivec"
56
Eric Christopher758aad72017-03-21 22:06:18 +000057// RUN: %clang -target powerpc64-unknown-linux-gnu %s -maltivec -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-3 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000058// CHECK-3: "-target-feature" "-altivec"
59
Eric Christopher758aad72017-03-21 22:06:18 +000060// RUN: %clang -target powerpc64-unknown-linux-gnu %s -maltivec -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-4 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000061// CHECK-4: "-target-feature" "-altivec"
62
Eric Christopher758aad72017-03-21 22:06:18 +000063// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -maltivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-5 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000064// CHECK-5-NOT: "-target-feature" "-altivec"
65
Eric Christopher758aad72017-03-21 22:06:18 +000066// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -maltivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-6 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000067// CHECK-6-NOT: "-target-feature" "-altivec"
68
Eric Christopher758aad72017-03-21 22:06:18 +000069// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=7400 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-7 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000070// CHECK-7: "-target-feature" "-altivec"
71
Eric Christopher758aad72017-03-21 22:06:18 +000072// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=g4 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-8 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000073// CHECK-8: "-target-feature" "-altivec"
74
Eric Christopher758aad72017-03-21 22:06:18 +000075// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=7450 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-9 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000076// CHECK-9: "-target-feature" "-altivec"
77
Eric Christopher758aad72017-03-21 22:06:18 +000078// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=g4+ -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-10 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000079// CHECK-10: "-target-feature" "-altivec"
80
Eric Christopher758aad72017-03-21 22:06:18 +000081// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=970 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-11 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000082// CHECK-11: "-target-feature" "-altivec"
83
Eric Christopher758aad72017-03-21 22:06:18 +000084// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=g5 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-12 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000085// CHECK-12: "-target-feature" "-altivec"
86
Eric Christopher758aad72017-03-21 22:06:18 +000087// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=pwr6 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-13 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000088// CHECK-13: "-target-feature" "-altivec"
89
Eric Christopher758aad72017-03-21 22:06:18 +000090// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=pwr7 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-14 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000091// CHECK-14: "-target-feature" "-altivec"
92
Eric Christopher758aad72017-03-21 22:06:18 +000093// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=pwr8 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-15 %s
Bill Schmidt102bb322013-02-01 14:45:29 +000094// CHECK-15: "-target-feature" "-altivec"
95
Eric Christopher758aad72017-03-21 22:06:18 +000096// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -mcpu=ppc64 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-16 %s
Will Schmidtf0487512014-06-26 13:34:10 +000097// CHECK-16: "-target-feature" "-altivec"
98
Hal Finkelb58ce852013-02-01 18:44:19 +000099// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-qpx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOQPX %s
100// CHECK-NOQPX: "-target-feature" "-qpx"
101
102// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-qpx -mqpx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-QPX %s
103// CHECK-QPX-NOT: "-target-feature" "-qpx"
104
Hal Finkel279ca4d2013-03-28 08:38:53 +0000105// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-mfcrf -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOMFCRF %s
106// CHECK-NOMFCRF: "-target-feature" "-mfocrf"
107
108// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-mfcrf -mmfcrf -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-MFCRF %s
109// CHECK-MFCRF: "-target-feature" "+mfocrf"
110
Olivier Sallenave5a41f922015-04-09 17:38:50 +0000111// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-isel -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOISEL %s
112// CHECK-NOISEL: "-target-feature" "-isel"
113
114// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-isel -misel -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-ISEL %s
115// CHECK-ISEL: "-target-feature" "+isel"
116
Hal Finkel1fe8b3d2013-03-28 13:51:36 +0000117// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-popcntd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOPOPCNTD %s
118// CHECK-NOPOPCNTD: "-target-feature" "-popcntd"
119
120// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-popcntd -mpopcntd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-POPCNTD %s
121// CHECK-POPCNTD: "-target-feature" "+popcntd"
122
Hal Finkel7d458592013-03-30 13:47:44 +0000123// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-fprnd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOFPRND %s
124// CHECK-NOFPRND: "-target-feature" "-fprnd"
125
126// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-fprnd -mfprnd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-FPRND %s
127// CHECK-FPRND: "-target-feature" "+fprnd"
Eric Christopher600130c2013-10-16 20:40:13 +0000128
Hal Finkel5ba18f72015-01-06 23:06:41 +0000129// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-cmpb -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCMPB %s
130// CHECK-NOCMPB: "-target-feature" "-cmpb"
131
132// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-cmpb -mcmpb -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CMPB %s
133// CHECK-CMPB: "-target-feature" "+cmpb"
134
Eric Christopher600130c2013-10-16 20:40:13 +0000135// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOVSX %s
136// CHECK-NOVSX: "-target-feature" "-vsx"
137
138// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -mvsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-VSX %s
139// CHECK-VSX: "-target-feature" "+vsx"
140
Eric Christopher74fa24f2017-03-20 21:12:53 +0000141// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-htm -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOHTM %s
142// CHECK-NOHTM: "-target-feature" "-htm"
143
144// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-htm -mhtm -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-HTM %s
145// CHECK-HTM: "-target-feature" "+htm"
146
Bill Schmidt59eb7672014-10-10 15:09:43 +0000147// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOP8VECTOR %s
148// CHECK-NOP8VECTOR: "-target-feature" "-power8-vector"
149
150// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -mpower8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-P8VECTOR %s
151// CHECK-P8VECTOR: "-target-feature" "+power8-vector"
152
Hal Finkel00a950f2014-02-28 00:27:57 +0000153// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
154// CHECK-NOCRBITS: "-target-feature" "-crbits"
155
156// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -mcrbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
157// CHECK-CRBITS: "-target-feature" "+crbits"
158
Hal Finkel5fe93df2016-08-30 01:07:03 +0000159// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-longcall -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOLONGCALL %s
160// CHECK-NOLONGCALL: "-target-feature" "-longcall"
161
162// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-longcall -mlongcall -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-LONGCALL %s
163// CHECK-LONGCALL: "-target-feature" "+longcall"
164
Hal Finkel74618cc2015-01-15 21:22:22 +0000165// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-invariant-function-descriptors -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOINVFUNCDESC %s
166// CHECK-NOINVFUNCDESC: "-target-feature" "-invariant-function-descriptors"
167
168// 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
169// CHECK-INVFUNCDESC: "-target-feature" "+invariant-function-descriptors"
170
Will Schmidtc1fc1902014-03-24 17:10:37 +0000171// Assembler features
Eric Christopher76471092014-10-06 17:33:18 +0000172// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_BE_AS_ARGS %s
Will Schmidtc1fc1902014-03-24 17:10:37 +0000173// CHECK_BE_AS_ARGS: "-mppc64"
174// CHECK_BE_AS_ARGS: "-many"
175
Eric Christopher76471092014-10-06 17:33:18 +0000176// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_LE_AS_ARGS %s
Will Schmidtc1fc1902014-03-24 17:10:37 +0000177// CHECK_LE_AS_ARGS: "-mppc64"
Will Schmidtc1fc1902014-03-24 17:10:37 +0000178// CHECK_LE_AS_ARGS: "-mlittle-endian"
Nemanja Ivanovicf88f81c2017-07-27 08:58:28 +0000179// CHECK_LE_AS_ARGS: "-mpower8"
Will Schmidtc1fc1902014-03-24 17:10:37 +0000180
181// linker features
182// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_BE_LD_ARGS %s
183// CHECK_BE_LD_ARGS: "elf64ppc"
184
185// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_LE_LD_ARGS %s
186// CHECK_LE_LD_ARGS: "elf64lppc"
187
Samuel Antaof8b50122015-07-13 22:54:53 +0000188// OpenMP features
189// RUN: %clang -target powerpc-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
190// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
191// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
192// CHECK_OPENMP_TLS-NOT: "-fnoopenmp-use-tls"