blob: 621c407d37ef1806a8b0defbbd7e1c7976d4f65c [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
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
Petar Jovanovic59a981a2015-12-14 19:22:35 +000027// CHECK-ERRMSG: error: invalid float ABI '-mfloat-abi=x'
Petar Jovanovic88a328f2015-12-14 17:51:50 +000028
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
Hal Finkel415c2a32016-10-02 02:10:45 +000031// CHECK-SOFTFLOAT64: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000032
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
Hal Finkel415c2a32016-10-02 02:10:45 +000035// CHECK-FLOATABISOFT64: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000036
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
Hal Finkel415c2a32016-10-02 02:10:45 +000039// CHECK-SOFTFLOAT64le: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000040
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
Hal Finkel415c2a32016-10-02 02:10:45 +000043// CHECK-FLOATABISOFT64le: "-target-feature" "-hard-float"
Petar Jovanovic88a328f2015-12-14 17:51:50 +000044
Eric Christopher758aad72017-03-21 22:06:18 +000045// Check that -mno-altivec correctly disables the altivec target feature on powerpc.
Bill Schmidt102bb322013-02-01 14:45:29 +000046
Eric Christopher758aad72017-03-21 22:06:18 +000047// 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 +000048// CHECK-1: "-target-feature" "-altivec"
49
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"
52
Eric Christopher758aad72017-03-21 22:06:18 +000053// 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 +000054// CHECK-3: "-target-feature" "-altivec"
55
Eric Christopher758aad72017-03-21 22:06:18 +000056// 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 +000057// CHECK-4: "-target-feature" "-altivec"
58
Eric Christopher758aad72017-03-21 22:06:18 +000059// 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 +000060// CHECK-5-NOT: "-target-feature" "-altivec"
61
Eric Christopher758aad72017-03-21 22:06:18 +000062// 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 +000063// CHECK-6-NOT: "-target-feature" "-altivec"
64
Eric Christopher758aad72017-03-21 22:06:18 +000065// 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 +000066// CHECK-7: "-target-feature" "-altivec"
67
Eric Christopher758aad72017-03-21 22:06:18 +000068// 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 +000069// CHECK-8: "-target-feature" "-altivec"
70
Eric Christopher758aad72017-03-21 22:06:18 +000071// 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 +000072// CHECK-9: "-target-feature" "-altivec"
73
Eric Christopher758aad72017-03-21 22:06:18 +000074// 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 +000075// CHECK-10: "-target-feature" "-altivec"
76
Eric Christopher758aad72017-03-21 22:06:18 +000077// 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 +000078// CHECK-11: "-target-feature" "-altivec"
79
Eric Christopher758aad72017-03-21 22:06:18 +000080// 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 +000081// CHECK-12: "-target-feature" "-altivec"
82
Eric Christopher758aad72017-03-21 22:06:18 +000083// 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 +000084// CHECK-13: "-target-feature" "-altivec"
85
Eric Christopher758aad72017-03-21 22:06:18 +000086// 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 +000087// CHECK-14: "-target-feature" "-altivec"
88
Eric Christopher758aad72017-03-21 22:06:18 +000089// 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 +000090// CHECK-15: "-target-feature" "-altivec"
91
Eric Christopher758aad72017-03-21 22:06:18 +000092// 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 +000093// CHECK-16: "-target-feature" "-altivec"
94
Hal Finkelb58ce852013-02-01 18:44:19 +000095// 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"
97
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"
100
Hal Finkel279ca4d2013-03-28 08:38:53 +0000101// 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"
103
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"
106
Olivier Sallenave5a41f922015-04-09 17:38:50 +0000107// 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"
109
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"
112
Hal Finkel1fe8b3d2013-03-28 13:51:36 +0000113// 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"
115
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"
118
Hal Finkel7d458592013-03-30 13:47:44 +0000119// 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"
121
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"
Eric Christopher600130c2013-10-16 20:40:13 +0000124
Hal Finkel5ba18f72015-01-06 23:06:41 +0000125// 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"
127
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"
130
Eric Christopher600130c2013-10-16 20:40:13 +0000131// 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"
133
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"
136
Eric Christopher74fa24f2017-03-20 21:12:53 +0000137// 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"
139
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"
142
Bill Schmidt59eb7672014-10-10 15:09:43 +0000143// 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"
145
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"
148
Hal Finkel00a950f2014-02-28 00:27:57 +0000149// 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"
151
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"
154
Hal Finkel5fe93df2016-08-30 01:07:03 +0000155// 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"
157
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"
160
Hal Finkel74618cc2015-01-15 21:22:22 +0000161// 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"
163
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"
166
Will Schmidtc1fc1902014-03-24 17:10:37 +0000167// Assembler features
Eric Christopher76471092014-10-06 17:33:18 +0000168// 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 +0000169// CHECK_BE_AS_ARGS: "-mppc64"
170// CHECK_BE_AS_ARGS: "-many"
171
Eric Christopher76471092014-10-06 17:33:18 +0000172// 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 +0000173// CHECK_LE_AS_ARGS: "-mppc64"
Will Schmidtc1fc1902014-03-24 17:10:37 +0000174// CHECK_LE_AS_ARGS: "-mlittle-endian"
Nemanja Ivanovicf88f81c2017-07-27 08:58:28 +0000175// CHECK_LE_AS_ARGS: "-mpower8"
Will Schmidtc1fc1902014-03-24 17:10:37 +0000176
177// linker features
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"
180
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"
183
Samuel Antaof8b50122015-07-13 22:54:53 +0000184// OpenMP features
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"