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