Andrey Turetskiy | b7a2967 | 2016-05-04 11:28:22 +0000 | [diff] [blame] | 1 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mx87 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=X87 %s |
| 2 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-x87 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-X87 %s |
| 3 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -m80387 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=X87 %s |
| 4 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-80387 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-X87 %s |
| 5 | // X87: "-target-feature" "+x87" |
| 6 | // NO-X87: "-target-feature" "-x87" |
| 7 | |
Andrey Turetskiy | d908849 | 2016-05-04 11:10:29 +0000 | [diff] [blame] | 8 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mmmx -m3dnow -m3dnowa %s -### -o %t.o 2>&1 | FileCheck -check-prefix=MMX %s |
| 9 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-mmx -mno-3dnow -mno-3dnowa %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-MMX %s |
| 10 | // MMX: "-target-feature" "+mmx" "-target-feature" "+3dnow" "-target-feature" "+3dnowa" |
| 11 | // NO-MMX: "-target-feature" "-mmx" "-target-feature" "-3dnow" "-target-feature" "-3dnowa" |
| 12 | |
| 13 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -msse -msse2 -msse3 -mssse3 -msse4a -msse4.1 -msse4.2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=SSE %s |
| 14 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-sse -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4a -mno-sse4.1 -mno-sse4.2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-SSE %s |
| 15 | // SSE: "-target-feature" "+sse" "-target-feature" "+sse2" "-target-feature" "+sse3" "-target-feature" "+ssse3" "-target-feature" "+sse4a" "-target-feature" "+sse4.1" "-target-feature" "+sse4.2" |
| 16 | // NO-SSE: "-target-feature" "-sse" "-target-feature" "-sse2" "-target-feature" "-sse3" "-target-feature" "-ssse3" "-target-feature" "-sse4a" "-target-feature" "-sse4.1" "-target-feature" "-sse4.2" |
| 17 | |
| 18 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -msse4 -maes %s -### -o %t.o 2>&1 | FileCheck -check-prefix=SSE4-AES %s |
| 19 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-sse4 -mno-aes %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-SSE4-AES %s |
| 20 | // SSE4-AES: "-target-feature" "+sse4.2" "-target-feature" "+aes" |
| 21 | // NO-SSE4-AES: "-target-feature" "-sse4.1" "-target-feature" "-aes" |
| 22 | |
Coby Tayree | a09663a | 2017-12-27 11:25:07 +0000 | [diff] [blame] | 23 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mavx -mavx2 -mavx512f -mavx512cd -mavx512er -mavx512pf -mavx512dq -mavx512bw -mavx512vl -mavx512vbmi -mavx512vbmi2 -mavx512ifma %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX %s |
| 24 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-avx -mno-avx2 -mno-avx512f -mno-avx512cd -mno-avx512er -mno-avx512pf -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512vbmi -mno-avx512vbmi2 -mno-avx512ifma %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-AVX %s |
| 25 | // AVX: "-target-feature" "+avx" "-target-feature" "+avx2" "-target-feature" "+avx512f" "-target-feature" "+avx512cd" "-target-feature" "+avx512er" "-target-feature" "+avx512pf" "-target-feature" "+avx512dq" "-target-feature" "+avx512bw" "-target-feature" "+avx512vl" "-target-feature" "+avx512vbmi" "-target-feature" "+avx512vbmi2" "-target-feature" "+avx512ifma" |
| 26 | // NO-AVX: "-target-feature" "-avx" "-target-feature" "-avx2" "-target-feature" "-avx512f" "-target-feature" "-avx512cd" "-target-feature" "-avx512er" "-target-feature" "-avx512pf" "-target-feature" "-avx512dq" "-target-feature" "-avx512bw" "-target-feature" "-avx512vl" "-target-feature" "-avx512vbmi" "-target-feature" "-avx512vbmi2" "-target-feature" "-avx512ifma" |
Andrey Turetskiy | d908849 | 2016-05-04 11:10:29 +0000 | [diff] [blame] | 27 | |
| 28 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mpclmul -mrdrnd -mfsgsbase -mbmi -mbmi2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=BMI %s |
| 29 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-pclmul -mno-rdrnd -mno-fsgsbase -mno-bmi -mno-bmi2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-BMI %s |
| 30 | // BMI: "-target-feature" "+pclmul" "-target-feature" "+rdrnd" "-target-feature" "+fsgsbase" "-target-feature" "+bmi" "-target-feature" "+bmi2" |
| 31 | // NO-BMI: "-target-feature" "-pclmul" "-target-feature" "-rdrnd" "-target-feature" "-fsgsbase" "-target-feature" "-bmi" "-target-feature" "-bmi2" |
| 32 | |
| 33 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mlzcnt -mpopcnt -mtbm -mfma -mfma4 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=FMA %s |
| 34 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-lzcnt -mno-popcnt -mno-tbm -mno-fma -mno-fma4 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-FMA %s |
| 35 | // FMA: "-target-feature" "+lzcnt" "-target-feature" "+popcnt" "-target-feature" "+tbm" "-target-feature" "+fma" "-target-feature" "+fma4" |
| 36 | // NO-FMA: "-target-feature" "-lzcnt" "-target-feature" "-popcnt" "-target-feature" "-tbm" "-target-feature" "-fma" "-target-feature" "-fma4" |
| 37 | |
| 38 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mxop -mf16c -mrtm -mprfchw -mrdseed %s -### -o %t.o 2>&1 | FileCheck -check-prefix=XOP %s |
| 39 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-xop -mno-f16c -mno-rtm -mno-prfchw -mno-rdseed %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-XOP %s |
| 40 | // XOP: "-target-feature" "+xop" "-target-feature" "+f16c" "-target-feature" "+rtm" "-target-feature" "+prfchw" "-target-feature" "+rdseed" |
| 41 | // NO-XOP: "-target-feature" "-xop" "-target-feature" "-f16c" "-target-feature" "-rtm" "-target-feature" "-prfchw" "-target-feature" "-rdseed" |
| 42 | |
| 43 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -msha -mpku -madx -mcx16 -mfxsr %s -### -o %t.o 2>&1 | FileCheck -check-prefix=SHA %s |
Andrey Turetskiy | f98266e | 2016-05-04 11:19:41 +0000 | [diff] [blame] | 44 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-sha -mno-pku -mno-adx -mno-cx16 -mno-fxsr %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-SHA %s |
Andrey Turetskiy | d908849 | 2016-05-04 11:10:29 +0000 | [diff] [blame] | 45 | // SHA: "-target-feature" "+sha" "-target-feature" "+pku" "-target-feature" "+adx" "-target-feature" "+cx16" "-target-feature" "+fxsr" |
Andrey Turetskiy | f98266e | 2016-05-04 11:19:41 +0000 | [diff] [blame] | 46 | // NO-SHA: "-target-feature" "-sha" "-target-feature" "-pku" "-target-feature" "-adx" "-target-feature" "-cx16" "-target-feature" "-fxsr" |
Andrey Turetskiy | d908849 | 2016-05-04 11:10:29 +0000 | [diff] [blame] | 47 | |
| 48 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mxsave -mxsaveopt -mxsavec -mxsaves %s -### -o %t.o 2>&1 | FileCheck -check-prefix=XSAVE %s |
| 49 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-xsave -mno-xsaveopt -mno-xsavec -mno-xsaves %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-XSAVE %s |
| 50 | // XSAVE: "-target-feature" "+xsave" "-target-feature" "+xsaveopt" "-target-feature" "+xsavec" "-target-feature" "+xsaves" |
| 51 | // NO-XSAVE: "-target-feature" "-xsave" "-target-feature" "-xsaveopt" "-target-feature" "-xsavec" "-target-feature" "-xsaves" |
Craig Topper | 78b4787 | 2017-02-08 06:48:58 +0000 | [diff] [blame] | 52 | |
| 53 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mclflushopt %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CLFLUSHOPT %s |
| 54 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-clflushopt %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-CLFLUSHOPT %s |
| 55 | // CLFLUSHOPT: "-target-feature" "+clflushopt" |
| 56 | // NO-CLFLUSHOPT: "-target-feature" "-clflushopt" |
Craig Topper | ef40aaf | 2017-02-08 07:13:19 +0000 | [diff] [blame] | 57 | |
Craig Topper | 8c708cf | 2017-02-08 07:36:58 +0000 | [diff] [blame] | 58 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mclwb %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CLWB %s |
| 59 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-clwb %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-CLWB %s |
| 60 | // CLWB: "-target-feature" "+clwb" |
| 61 | // NO-CLWB: "-target-feature" "-clwb" |
| 62 | |
Craig Topper | ef40aaf | 2017-02-08 07:13:19 +0000 | [diff] [blame] | 63 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mmovbe %s -### -o %t.o 2>&1 | FileCheck -check-prefix=MOVBE %s |
| 64 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-movbe %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-MOVBE %s |
| 65 | // MOVBE: "-target-feature" "+movbe" |
| 66 | // NO-MOVBE: "-target-feature" "-movbe" |
Craig Topper | b16cb82 | 2017-02-08 07:56:42 +0000 | [diff] [blame] | 67 | |
| 68 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mmpx %s -### -o %t.o 2>&1 | FileCheck -check-prefix=MPX %s |
| 69 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-mpx %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-MPX %s |
| 70 | // MPX: "-target-feature" "+mpx" |
| 71 | // NO-MPX: "-target-feature" "-mpx" |
Craig Topper | 204ecff | 2017-02-08 08:23:17 +0000 | [diff] [blame] | 72 | |
Oren Ben Simhon | fec21ec | 2017-11-26 12:34:54 +0000 | [diff] [blame] | 73 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mshstk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CETSS %s |
| 74 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-shstk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-CETSS %s |
| 75 | // CETSS: "-target-feature" "+shstk" |
| 76 | // NO-CETSS: "-target-feature" "-shstk" |
| 77 | |
| 78 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mibt %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CETIBT %s |
| 79 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-ibt %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-CETIBT %s |
| 80 | // CETIBT: "-target-feature" "+ibt" |
| 81 | // NO-CETIBT: "-target-feature" "-ibt" |
| 82 | |
Craig Topper | 204ecff | 2017-02-08 08:23:17 +0000 | [diff] [blame] | 83 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -msgx %s -### -o %t.o 2>&1 | FileCheck -check-prefix=SGX %s |
| 84 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-sgx %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-SGX %s |
| 85 | // SGX: "-target-feature" "+sgx" |
| 86 | // NO-SGX: "-target-feature" "-sgx" |
Craig Topper | d2bf7b0 | 2017-02-08 08:23:40 +0000 | [diff] [blame] | 87 | |
| 88 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mprefetchwt1 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=PREFETCHWT1 %s |
| 89 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-prefetchwt1 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-PREFETCHWT1 %s |
| 90 | // PREFETCHWT1: "-target-feature" "+prefetchwt1" |
| 91 | // NO-PREFETCHWT1: "-target-feature" "-prefetchwt1" |
Craig Topper | 4574226 | 2017-02-09 06:10:14 +0000 | [diff] [blame] | 92 | |
| 93 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mclzero %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CLZERO %s |
| 94 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-clzero %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-CLZERO %s |
| 95 | // CLZERO: "-target-feature" "+clzero" |
| 96 | // NO-CLZERO: "-target-feature" "-clzero" |
Coby Tayree | a1e5f0c | 2017-12-27 08:16:54 +0000 | [diff] [blame] | 97 | |
| 98 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mvaes %s -### -o %t.o 2>&1 | FileCheck -check-prefix=VAES %s |
| 99 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-vaes %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-VAES %s |
| 100 | // VAES: "-target-feature" "+vaes" |
| 101 | // NO-VAES: "-target-feature" "-vaes" |
| 102 | |
Coby Tayree | f4811eb | 2017-12-27 08:37:47 +0000 | [diff] [blame] | 103 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mgfni %s -### -o %t.o 2>&1 | FileCheck -check-prefix=GFNI %s |
| 104 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-gfni %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-GFNI %s |
| 105 | // GFNI: "-target-feature" "+gfni" |
| 106 | // NO-GFNI: "-target-feature" "-gfni |
| 107 | |
Coby Tayree | cf96c87 | 2017-12-27 09:00:31 +0000 | [diff] [blame] | 108 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mvpclmulqdq %s -### -o %t.o 2>&1 | FileCheck -check-prefix=VPCLMULQDQ %s |
| 109 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-vpclmulqdq %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-VPCLMULQDQ %s |
| 110 | // VPCLMULQDQ: "-target-feature" "+vpclmulqdq" |
| 111 | // NO-VPCLMULQDQ: "-target-feature" "-vpclmulqdq" |
Coby Tayree | f72630b | 2017-12-27 09:22:34 +0000 | [diff] [blame] | 112 | |
Coby Tayree | 2268576 | 2017-12-27 10:01:00 +0000 | [diff] [blame] | 113 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mavx512bitalg %s -### -o %t.o 2>&1 | FileCheck -check-prefix=BITALG %s |
| 114 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-avx512bitalg %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-BITALG %s |
| 115 | // BITALG: "-target-feature" "+avx512bitalg" |
| 116 | // NO-BITALG: "-target-feature" "-avx512bitalg" |
| 117 | |
Coby Tayree | 3d9c88c | 2017-12-27 10:37:51 +0000 | [diff] [blame] | 118 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mavx512vnni %s -### -o %t.o 2>&1 | FileCheck -check-prefix=VNNI %s |
| 119 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-avx512vnni %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-VNNI %s |
| 120 | // VNNI: "-target-feature" "+avx512vnni" |
| 121 | // NO-VNNI: "-target-feature" "-avx512vnni" |
| 122 | |
Coby Tayree | a09663a | 2017-12-27 11:25:07 +0000 | [diff] [blame] | 123 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mavx512vbmi2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=VBMI2 %s |
| 124 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-avx512vbmi2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-VBMI2 %s |
| 125 | // VBMI2: "-target-feature" "+avx512vbmi2" |
| 126 | // NO-VBMI2: "-target-feature" "-avx512vbmi2" |
| 127 | |
Craig Topper | 8cdb949 | 2018-01-20 18:36:52 +0000 | [diff] [blame] | 128 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mrdpid %s -### -o %t.o 2>&1 | FileCheck -check-prefix=RDPID %s |
| 129 | // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-rdpid %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-RDPID %s |
| 130 | // RDPID: "-target-feature" "+rdpid" |
| 131 | // NO-RDPID: "-target-feature" "-rdpid" |
Chandler Carruth | c58f216 | 2018-01-22 22:05:25 +0000 | [diff] [blame] | 132 | |
| 133 | // RUN: %clang -target i386-linux-gnu -mretpoline %s -### -o %t.o 2>&1 | FileCheck -check-prefix=RETPOLINE %s |
| 134 | // RUN: %clang -target i386-linux-gnu -mno-retpoline %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-RETPOLINE %s |
| 135 | // RETPOLINE: "-target-feature" "+retpoline" |
| 136 | // NO-RETPOLINE: "-target-feature" "-retpoline" |
| 137 | |
| 138 | // RUN: %clang -target i386-linux-gnu -mretpoline -mretpoline-external-thunk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=RETPOLINE-EXTERNAL-THUNK %s |
| 139 | // RUN: %clang -target i386-linux-gnu -mretpoline -mno-retpoline-external-thunk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-RETPOLINE-EXTERNAL-THUNK %s |
| 140 | // RETPOLINE-EXTERNAL-THUNK: "-target-feature" "+retpoline-external-thunk" |
| 141 | // NO-RETPOLINE-EXTERNAL-THUNK: "-target-feature" "-retpoline-external-thunk" |