blob: 34c1ce5cc4dbb6e9f625d5ab3e3dbcab9ccb75ae [file] [log] [blame]
Chad Rosierb8d8b4c2012-03-13 23:48:50 +00001// Check that we error when -faltivec is specified on non-ppc platforms.
Chad Rosier864dfe12012-03-13 23:45:51 +00002
Rafael Espindolafc3fc0c2012-10-09 20:46:28 +00003// RUN: %clang -target powerpc-unk-unk -faltivec -fsyntax-only %s
4// RUN: %clang -target powerpc64-linux-gnu -faltivec -fsyntax-only %s
5// RUN: %clang -target powerpc64-linux-gnu -maltivec -fsyntax-only %s
Chad Rosier864dfe12012-03-13 23:45:51 +00006
Rafael Espindola925213b2013-07-04 16:16:58 +00007// RUN: not %clang -target i386-pc-win32 -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
8// RUN: not %clang -target x86_64-unknown-freebsd -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
9// RUN: not %clang -target armv6-apple-darwin -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
10// RUN: not %clang -target armv7-apple-darwin -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
11// RUN: not %clang -target mips-linux-gnu -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
12// RUN: not %clang -target mips64-linux-gnu -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
13// RUN: not %clang -target sparc-unknown-solaris -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
Benjamin Kramer91b9ac82012-03-14 01:17:52 +000014
Petar Jovanovic88a328f2015-12-14 17:51:50 +000015// check -msoft-float option for ppc32
16// RUN: %clang -target powerpc-unknown-linux-gnu %s -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTFLOAT %s
17// CHECK-SOFTFLOAT: "-target-feature" "+soft-float"
18
19// check -mfloat-abi=soft option for ppc32
20// RUN: %clang -target powerpc-unknown-linux-gnu %s -mfloat-abi=soft -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABISOFT %s
21// CHECK-FLOATABISOFT: "-target-feature" "+soft-float"
22
23// check -mhard-float option for ppc32
24// RUN: %clang -target powerpc-unknown-linux-gnu %s -mhard-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-HARDFLOAT %s
25// CHECK-HARDFLOAT-NOT: "-target-feature" "+soft-float"
26
27// check -mfloat-abi=hard option for ppc32
28// RUN: %clang -target powerpc-unknown-linux-gnu %s -mfloat-abi=hard -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABIHARD %s
29// CHECK-FLOATABIHARD-NOT: "-target-feature" "+soft-float"
30
31// check combine -mhard-float -msoft-float option for ppc32
32// RUN: %clang -target powerpc-unknown-linux-gnu %s -mhard-float -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-HARDSOFT %s
33// CHECK-HARDSOFT: "-target-feature" "+soft-float"
34
35// check combine -msoft-float -mhard-float option for ppc32
36// RUN: %clang -target powerpc-unknown-linux-gnu %s -msoft-float -mhard-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTHARD %s
37// CHECK-SOFTHARD-NOT: "-target-feature" "+soft-float"
38
39// check -mfloat-abi=x option
40// 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 +000041// CHECK-ERRMSG: error: invalid float ABI '-mfloat-abi=x'
Petar Jovanovic88a328f2015-12-14 17:51:50 +000042
43// check -msoft-float option for ppc64
44// RUN: %clang -target powerpc64-unknown-linux-gnu %s -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTFLOAT64 %s
Petar Jovanovic59a981a2015-12-14 19:22:35 +000045// CHECK-SOFTFLOAT64: error: invalid float ABI 'soft float is not supported for ppc64'
Petar Jovanovic88a328f2015-12-14 17:51:50 +000046
47// check -mfloat-abi=soft option for ppc64
48// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mfloat-abi=soft -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABISOFT64 %s
Petar Jovanovic59a981a2015-12-14 19:22:35 +000049// CHECK-FLOATABISOFT64: error: invalid float ABI 'soft float is not supported for ppc64'
Petar Jovanovic88a328f2015-12-14 17:51:50 +000050
51// check -msoft-float option for ppc64
52// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -msoft-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTFLOAT64le %s
Petar Jovanovic59a981a2015-12-14 19:22:35 +000053// CHECK-SOFTFLOAT64le: error: invalid float ABI 'soft float is not supported for ppc64'
Petar Jovanovic88a328f2015-12-14 17:51:50 +000054
55// check -mfloat-abi=soft option for ppc64
56// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -mfloat-abi=soft -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-FLOATABISOFT64le %s
Petar Jovanovic59a981a2015-12-14 19:22:35 +000057// CHECK-FLOATABISOFT64le: error: invalid float ABI 'soft float is not supported for ppc64'
Petar Jovanovic88a328f2015-12-14 17:51:50 +000058
Bill Schmidt778d3872013-07-26 01:36:11 +000059// CHECK: invalid argument '-faltivec' only allowed with 'ppc/ppc64/ppc64le'
Bill Schmidt102bb322013-02-01 14:45:29 +000060
61// Check that -fno-altivec and -mno-altivec correctly disable the altivec
62// target feature on powerpc.
63
64// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-1 %s
65// CHECK-1: "-target-feature" "-altivec"
66
67// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-2 %s
68// CHECK-2: "-target-feature" "-altivec"
69
70// RUN: %clang -target powerpc64-unknown-linux-gnu %s -faltivec -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-3 %s
71// CHECK-3: "-target-feature" "-altivec"
72
73// RUN: %clang -target powerpc64-unknown-linux-gnu %s -maltivec -fno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-4 %s
74// CHECK-4: "-target-feature" "-altivec"
75
76// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -faltivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-5 %s
77// CHECK-5-NOT: "-target-feature" "-altivec"
78
79// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -maltivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-6 %s
80// CHECK-6-NOT: "-target-feature" "-altivec"
81
82// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=7400 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-7 %s
83// CHECK-7: "-target-feature" "-altivec"
84
85// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=g4 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-8 %s
86// CHECK-8: "-target-feature" "-altivec"
87
88// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=7450 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-9 %s
89// CHECK-9: "-target-feature" "-altivec"
90
91// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=g4+ -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-10 %s
92// CHECK-10: "-target-feature" "-altivec"
93
94// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=970 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-11 %s
95// CHECK-11: "-target-feature" "-altivec"
96
97// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=g5 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-12 %s
98// CHECK-12: "-target-feature" "-altivec"
99
100// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=pwr6 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-13 %s
101// CHECK-13: "-target-feature" "-altivec"
102
103// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=pwr7 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-14 %s
104// CHECK-14: "-target-feature" "-altivec"
105
Will Schmidtf0487512014-06-26 13:34:10 +0000106// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=pwr8 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-15 %s
Bill Schmidt102bb322013-02-01 14:45:29 +0000107// CHECK-15: "-target-feature" "-altivec"
108
Will Schmidtf0487512014-06-26 13:34:10 +0000109// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=ppc64 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-16 %s
110// CHECK-16: "-target-feature" "-altivec"
111
Hal Finkelb58ce852013-02-01 18:44:19 +0000112// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-qpx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOQPX %s
113// CHECK-NOQPX: "-target-feature" "-qpx"
114
115// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-qpx -mqpx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-QPX %s
116// CHECK-QPX-NOT: "-target-feature" "-qpx"
117
Hal Finkel279ca4d2013-03-28 08:38:53 +0000118// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-mfcrf -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOMFCRF %s
119// CHECK-NOMFCRF: "-target-feature" "-mfocrf"
120
121// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-mfcrf -mmfcrf -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-MFCRF %s
122// CHECK-MFCRF: "-target-feature" "+mfocrf"
123
Olivier Sallenave5a41f922015-04-09 17:38:50 +0000124// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-isel -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOISEL %s
125// CHECK-NOISEL: "-target-feature" "-isel"
126
127// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-isel -misel -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-ISEL %s
128// CHECK-ISEL: "-target-feature" "+isel"
129
Hal Finkel1fe8b3d2013-03-28 13:51:36 +0000130// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-popcntd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOPOPCNTD %s
131// CHECK-NOPOPCNTD: "-target-feature" "-popcntd"
132
133// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-popcntd -mpopcntd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-POPCNTD %s
134// CHECK-POPCNTD: "-target-feature" "+popcntd"
135
Hal Finkel7d458592013-03-30 13:47:44 +0000136// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-fprnd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOFPRND %s
137// CHECK-NOFPRND: "-target-feature" "-fprnd"
138
139// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-fprnd -mfprnd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-FPRND %s
140// CHECK-FPRND: "-target-feature" "+fprnd"
Eric Christopher600130c2013-10-16 20:40:13 +0000141
Hal Finkel5ba18f72015-01-06 23:06:41 +0000142// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-cmpb -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCMPB %s
143// CHECK-NOCMPB: "-target-feature" "-cmpb"
144
145// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-cmpb -mcmpb -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CMPB %s
146// CHECK-CMPB: "-target-feature" "+cmpb"
147
Eric Christopher600130c2013-10-16 20:40:13 +0000148// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOVSX %s
149// CHECK-NOVSX: "-target-feature" "-vsx"
150
151// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -mvsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-VSX %s
152// CHECK-VSX: "-target-feature" "+vsx"
153
Bill Schmidt59eb7672014-10-10 15:09:43 +0000154// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOP8VECTOR %s
155// CHECK-NOP8VECTOR: "-target-feature" "-power8-vector"
156
157// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -mpower8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-P8VECTOR %s
158// CHECK-P8VECTOR: "-target-feature" "+power8-vector"
159
Hal Finkel00a950f2014-02-28 00:27:57 +0000160// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
161// CHECK-NOCRBITS: "-target-feature" "-crbits"
162
163// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -mcrbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
164// CHECK-CRBITS: "-target-feature" "+crbits"
165
Hal Finkel74618cc2015-01-15 21:22:22 +0000166// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-invariant-function-descriptors -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOINVFUNCDESC %s
167// CHECK-NOINVFUNCDESC: "-target-feature" "-invariant-function-descriptors"
168
169// 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
170// CHECK-INVFUNCDESC: "-target-feature" "+invariant-function-descriptors"
171
Will Schmidtc1fc1902014-03-24 17:10:37 +0000172// Assembler features
Eric Christopher76471092014-10-06 17:33:18 +0000173// 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 +0000174// CHECK_BE_AS_ARGS: "-mppc64"
175// CHECK_BE_AS_ARGS: "-many"
176
Eric Christopher76471092014-10-06 17:33:18 +0000177// 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 +0000178// CHECK_LE_AS_ARGS: "-mppc64"
179// CHECK_LE_AS_ARGS: "-many"
180// CHECK_LE_AS_ARGS: "-mlittle-endian"
181
182// linker features
183// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_BE_LD_ARGS %s
184// CHECK_BE_LD_ARGS: "elf64ppc"
185
186// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_LE_LD_ARGS %s
187// CHECK_LE_LD_ARGS: "elf64lppc"
188
Samuel Antaof8b50122015-07-13 22:54:53 +0000189// OpenMP features
190// RUN: %clang -target powerpc-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
191// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
192// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s
193// CHECK_OPENMP_TLS-NOT: "-fnoopenmp-use-tls"