Chad Rosier | b8d8b4c | 2012-03-13 23:48:50 +0000 | [diff] [blame] | 1 | // Check that we error when -faltivec is specified on non-ppc platforms. |
Chad Rosier | 864dfe1 | 2012-03-13 23:45:51 +0000 | [diff] [blame] | 2 | |
Rafael Espindola | fc3fc0c | 2012-10-09 20:46:28 +0000 | [diff] [blame] | 3 | // 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 Rosier | 864dfe1 | 2012-03-13 23:45:51 +0000 | [diff] [blame] | 6 | |
Rafael Espindola | 925213b | 2013-07-04 16:16:58 +0000 | [diff] [blame] | 7 | // 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 Kramer | 91b9ac8 | 2012-03-14 01:17:52 +0000 | [diff] [blame] | 14 | |
Petar Jovanovic | 88a328f | 2015-12-14 17:51:50 +0000 | [diff] [blame] | 15 | // 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 Jovanovic | 59a981a | 2015-12-14 19:22:35 +0000 | [diff] [blame] | 41 | // CHECK-ERRMSG: error: invalid float ABI '-mfloat-abi=x' |
Petar Jovanovic | 88a328f | 2015-12-14 17:51:50 +0000 | [diff] [blame] | 42 | |
| 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 Jovanovic | 59a981a | 2015-12-14 19:22:35 +0000 | [diff] [blame] | 45 | // CHECK-SOFTFLOAT64: error: invalid float ABI 'soft float is not supported for ppc64' |
Petar Jovanovic | 88a328f | 2015-12-14 17:51:50 +0000 | [diff] [blame] | 46 | |
| 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 Jovanovic | 59a981a | 2015-12-14 19:22:35 +0000 | [diff] [blame] | 49 | // CHECK-FLOATABISOFT64: error: invalid float ABI 'soft float is not supported for ppc64' |
Petar Jovanovic | 88a328f | 2015-12-14 17:51:50 +0000 | [diff] [blame] | 50 | |
| 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 Jovanovic | 59a981a | 2015-12-14 19:22:35 +0000 | [diff] [blame] | 53 | // CHECK-SOFTFLOAT64le: error: invalid float ABI 'soft float is not supported for ppc64' |
Petar Jovanovic | 88a328f | 2015-12-14 17:51:50 +0000 | [diff] [blame] | 54 | |
| 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 Jovanovic | 59a981a | 2015-12-14 19:22:35 +0000 | [diff] [blame] | 57 | // CHECK-FLOATABISOFT64le: error: invalid float ABI 'soft float is not supported for ppc64' |
Petar Jovanovic | 88a328f | 2015-12-14 17:51:50 +0000 | [diff] [blame] | 58 | |
Bill Schmidt | 778d387 | 2013-07-26 01:36:11 +0000 | [diff] [blame] | 59 | // CHECK: invalid argument '-faltivec' only allowed with 'ppc/ppc64/ppc64le' |
Bill Schmidt | 102bb32 | 2013-02-01 14:45:29 +0000 | [diff] [blame] | 60 | |
| 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 Schmidt | f048751 | 2014-06-26 13:34:10 +0000 | [diff] [blame] | 106 | // RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=pwr8 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-15 %s |
Bill Schmidt | 102bb32 | 2013-02-01 14:45:29 +0000 | [diff] [blame] | 107 | // CHECK-15: "-target-feature" "-altivec" |
| 108 | |
Will Schmidt | f048751 | 2014-06-26 13:34:10 +0000 | [diff] [blame] | 109 | // 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 Finkel | b58ce85 | 2013-02-01 18:44:19 +0000 | [diff] [blame] | 112 | // 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 Finkel | 279ca4d | 2013-03-28 08:38:53 +0000 | [diff] [blame] | 118 | // 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 Sallenave | 5a41f92 | 2015-04-09 17:38:50 +0000 | [diff] [blame] | 124 | // 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 Finkel | 1fe8b3d | 2013-03-28 13:51:36 +0000 | [diff] [blame] | 130 | // 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 Finkel | 7d45859 | 2013-03-30 13:47:44 +0000 | [diff] [blame] | 136 | // 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 Christopher | 600130c | 2013-10-16 20:40:13 +0000 | [diff] [blame] | 141 | |
Hal Finkel | 5ba18f7 | 2015-01-06 23:06:41 +0000 | [diff] [blame] | 142 | // 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 Christopher | 600130c | 2013-10-16 20:40:13 +0000 | [diff] [blame] | 148 | // 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 Schmidt | 59eb767 | 2014-10-10 15:09:43 +0000 | [diff] [blame] | 154 | // 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 Finkel | 00a950f | 2014-02-28 00:27:57 +0000 | [diff] [blame] | 160 | // 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 Finkel | 74618cc | 2015-01-15 21:22:22 +0000 | [diff] [blame] | 166 | // 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 Schmidt | c1fc190 | 2014-03-24 17:10:37 +0000 | [diff] [blame] | 172 | // Assembler features |
Eric Christopher | 7647109 | 2014-10-06 17:33:18 +0000 | [diff] [blame] | 173 | // 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 Schmidt | c1fc190 | 2014-03-24 17:10:37 +0000 | [diff] [blame] | 174 | // CHECK_BE_AS_ARGS: "-mppc64" |
| 175 | // CHECK_BE_AS_ARGS: "-many" |
| 176 | |
Eric Christopher | 7647109 | 2014-10-06 17:33:18 +0000 | [diff] [blame] | 177 | // 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 Schmidt | c1fc190 | 2014-03-24 17:10:37 +0000 | [diff] [blame] | 178 | // 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 Antao | f8b5012 | 2015-07-13 22:54:53 +0000 | [diff] [blame] | 189 | // 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" |