1 // Check passing options to the assembler for MIPS targets. 2 // 3 // RUN: %clang -target mips-linux-gnu -### \ 4 // RUN: -no-integrated-as -c %s 2>&1 \ 5 // RUN: | FileCheck -check-prefix=MIPS32R2-EB-AS %s 6 // RUN: %clang -target mipsel-linux-gnu -### \ 7 // RUN: -no-integrated-as -c -EB %s 2>&1 \ 8 // RUN: | FileCheck -check-prefix=MIPS32R2-EB-AS %s 9 // MIPS32R2-EB-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 10 // MIPS32R2-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" 11 // 12 // RUN: %clang -target mips-linux-gnu -### \ 13 // RUN: -no-integrated-as -fPIC -c %s 2>&1 \ 14 // RUN: | FileCheck -check-prefix=MIPS32R2-EB-PIC %s 15 // MIPS32R2-EB-PIC: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-call_nonpic" "-EB" 16 // MIPS32R2-EB-PIC: "-KPIC" 17 // 18 // RUN: %clang -target mipsel-linux-gnu -### \ 19 // RUN: -no-integrated-as -c %s 2>&1 \ 20 // RUN: | FileCheck -check-prefix=MIPS32R2-DEF-EL-AS %s 21 // MIPS32R2-DEF-EL-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EL" 22 // 23 // RUN: %clang -target mips64-linux-gnu -### \ 24 // RUN: -no-integrated-as -c %s 2>&1 \ 25 // RUN: | FileCheck -check-prefix=MIPS64R2-EB-AS %s 26 // MIPS64R2-EB-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" 27 // 28 // RUN: %clang -target mips64el-linux-gnu -### \ 29 // RUN: -no-integrated-as -c %s 2>&1 \ 30 // RUN: | FileCheck -check-prefix=MIPS64R2-DEF-EL-AS %s 31 // MIPS64R2-DEF-EL-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EL" 32 // 33 // RUN: %clang -target mips-linux-gnu -mabi=eabi -### \ 34 // RUN: -no-integrated-as -c %s 2>&1 \ 35 // RUN: | FileCheck -check-prefix=MIPS-EABI %s 36 // MIPS-EABI: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "eabi" "-mno-shared" "-call_nonpic" "-EB" 37 // 38 // RUN: %clang -target mips64-linux-gnu -mabi=n32 -### \ 39 // RUN: -no-integrated-as -c %s 2>&1 \ 40 // RUN: | FileCheck -check-prefix=MIPS-N32 %s 41 // MIPS-N32: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "n32" "-mno-shared" "-call_nonpic" "-EB" 42 // 43 // RUN: %clang -target mipsel-linux-gnu -mabi=32 -### \ 44 // RUN: -no-integrated-as -c %s 2>&1 \ 45 // RUN: | FileCheck -check-prefix=MIPS32R2-EL-AS %s 46 // RUN: %clang -target mips-linux-gnu -mabi=32 -### \ 47 // RUN: -no-integrated-as -c %s -EL 2>&1 \ 48 // RUN: | FileCheck -check-prefix=MIPS32R2-EL-AS %s 49 // MIPS32R2-EL-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EL" 50 // 51 // RUN: %clang -target mips64el-linux-gnu -mabi=64 -### \ 52 // RUN: -no-integrated-as -c %s 2>&1 \ 53 // RUN: | FileCheck -check-prefix=MIPS64R2-EL-AS %s 54 // MIPS64R2-EL-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EL" 55 // 56 // RUN: %clang -target mips-linux-gnu -march=mips32r2 -### \ 57 // RUN: -no-integrated-as -c %s 2>&1 \ 58 // RUN: | FileCheck -check-prefix=MIPS-32R2 %s 59 // MIPS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 60 // 61 // RUN: %clang -target mips64-linux-gnu -march=octeon -### \ 62 // RUN: -no-integrated-as -c %s 2>&1 \ 63 // RUN: | FileCheck -check-prefix=MIPS-OCTEON %s 64 // MIPS-OCTEON: as{{(.exe)?}}" "-march" "octeon" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" 65 // 66 // RUN: %clang -target mips-linux-gnu -mips1 -### \ 67 // RUN: -no-integrated-as -c %s 2>&1 \ 68 // RUN: | FileCheck -check-prefix=MIPS-ALIAS-1 %s 69 // MIPS-ALIAS-1: as{{(.exe)?}}" "-march" "mips1" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 70 // 71 // RUN: %clang -target mips-linux-gnu -mips2 -### \ 72 // RUN: -no-integrated-as -c %s 2>&1 \ 73 // RUN: | FileCheck -check-prefix=MIPS-ALIAS-2 %s 74 // MIPS-ALIAS-2: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 75 // 76 // RUN: %clang -target mips-linux-gnu -mips3 -### \ 77 // RUN: -no-integrated-as -c %s 2>&1 \ 78 // RUN: | FileCheck -check-prefix=MIPS-ALIAS-3 %s 79 // MIPS-ALIAS-3: as{{(.exe)?}}" "-march" "mips3" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 80 // 81 // RUN: %clang -target mips-linux-gnu -mips4 -### \ 82 // RUN: -no-integrated-as -c %s 2>&1 \ 83 // RUN: | FileCheck -check-prefix=MIPS-ALIAS-4 %s 84 // MIPS-ALIAS-4: as{{(.exe)?}}" "-march" "mips4" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 85 // 86 // RUN: %clang -target mips-linux-gnu -mips5 -### \ 87 // RUN: -no-integrated-as -c %s 2>&1 \ 88 // RUN: | FileCheck -check-prefix=MIPS-ALIAS-5 %s 89 // MIPS-ALIAS-5: as{{(.exe)?}}" "-march" "mips5" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 90 // 91 // RUN: %clang -target mips-linux-gnu -mips32 -### \ 92 // RUN: -no-integrated-as -c %s 2>&1 \ 93 // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32 %s 94 // MIPS-ALIAS-32: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 95 // 96 // RUN: %clang -target mips-linux-gnu -mips32r2 -### \ 97 // RUN: -no-integrated-as -c %s 2>&1 \ 98 // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R2 %s 99 // MIPS-ALIAS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 100 // 101 // RUN: %clang -target mips-linux-gnu -mips32r6 -### \ 102 // RUN: -no-integrated-as -c %s 2>&1 \ 103 // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R6 %s 104 // MIPS-ALIAS-32R6: as{{(.exe)?}}" "-march" "mips32r6" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 105 // 106 // RUN: %clang -target mips64-linux-gnu -mips64 -### \ 107 // RUN: -no-integrated-as -c %s 2>&1 \ 108 // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64 %s 109 // MIPS-ALIAS-64: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" 110 // 111 // RUN: %clang -target mips64-linux-gnu -mips64r2 -### \ 112 // RUN: -no-integrated-as -c %s 2>&1 \ 113 // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R2 %s 114 // MIPS-ALIAS-64R2: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" 115 // 116 // RUN: %clang -target mips64-linux-gnu -mips64r6 -### \ 117 // RUN: -no-integrated-as -c %s 2>&1 \ 118 // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R6 %s 119 // MIPS-ALIAS-64R6: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" 120 // 121 // RUN: %clang -target mips-linux-gnu -mno-mips16 -mips16 -### \ 122 // RUN: -no-integrated-as -c %s 2>&1 \ 123 // RUN: | FileCheck -check-prefix=MIPS-16 %s 124 // MIPS-16: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mips16" 125 // 126 // RUN: %clang -target mips-linux-gnu -mips16 -mno-mips16 -### \ 127 // RUN: -no-integrated-as -c %s 2>&1 \ 128 // RUN: | FileCheck -check-prefix=MIPS-N16 %s 129 // MIPS-N16: as{{(.exe)?}}" 130 // MIPS-N16: -no-mips16 131 // 132 // RUN: %clang -target mips-linux-gnu -mno-micromips -mmicromips -### \ 133 // RUN: -no-integrated-as -c %s 2>&1 \ 134 // RUN: | FileCheck -check-prefix=MIPS-MICRO %s 135 // MIPS-MICRO: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mmicromips" 136 // 137 // RUN: %clang -target mips-linux-gnu -mmicromips -mno-micromips -### \ 138 // RUN: -no-integrated-as -c %s 2>&1 \ 139 // RUN: | FileCheck -check-prefix=MIPS-NMICRO %s 140 // MIPS-NMICRO: as{{(.exe)?}}" 141 // MIPS-NMICRO-NOT: {{[A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-mmicromips" 142 // 143 // RUN: %clang -target mips-linux-gnu -mno-dsp -mdsp -### \ 144 // RUN: -no-integrated-as -c %s 2>&1 \ 145 // RUN: | FileCheck -check-prefix=MIPS-DSP %s 146 // MIPS-DSP: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mdsp" 147 // 148 // RUN: %clang -target mips-linux-gnu -mdsp -mno-dsp -### \ 149 // RUN: -no-integrated-as -c %s 2>&1 \ 150 // RUN: | FileCheck -check-prefix=MIPS-NDSP %s 151 // MIPS-NDSP: as{{(.exe)?}}" 152 // MIPS-NDSP-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-mdsp" 153 // 154 // RUN: %clang -target mips-linux-gnu -mno-dspr2 -mdspr2 -### \ 155 // RUN: -no-integrated-as -c %s 2>&1 \ 156 // RUN: | FileCheck -check-prefix=MIPS-DSPR2 %s 157 // MIPS-DSPR2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mdspr2" 158 // 159 // RUN: %clang -target mips-linux-gnu -mdspr2 -mno-dspr2 -### \ 160 // RUN: -no-integrated-as -c %s 2>&1 \ 161 // RUN: | FileCheck -check-prefix=MIPS-NDSPR2 %s 162 // MIPS-NDSPR2: as{{(.exe)?}}" 163 // MIPS-NDSPR2-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-mdspr2" 164 // 165 // RUN: %clang -target mips-linux-gnu -mnan=legacy -mnan=2008 -### \ 166 // RUN: -no-integrated-as -c %s 2>&1 \ 167 // RUN: | FileCheck -check-prefix=MIPS-NAN2008 %s 168 // MIPS-NAN2008: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mnan=2008" 169 // 170 // RUN: %clang -target mips-linux-gnu -mnan=2008 -mnan=legacy -### \ 171 // RUN: -no-integrated-as -c %s 2>&1 \ 172 // RUN: | FileCheck -check-prefix=MIPS-NAN-LEGACY %s 173 // MIPS-NAN-LEGACY: as{{(.exe)?}}" 174 // MIPS-NAN-LEGACY-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-mnan={{.*}}" 175 // 176 // RUN: %clang -target mips-linux-gnu -mfp64 -mfpxx -mfp32 -### \ 177 // RUN: -no-integrated-as -c %s 2>&1 \ 178 // RUN: | FileCheck -check-prefix=MIPS-MFP32 %s 179 // MIPS-MFP32: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mfp32" 180 // 181 // RUN: %clang -target mips-linux-gnu -mfp32 -mfp64 -mfpxx -### \ 182 // RUN: -no-integrated-as -c %s 2>&1 \ 183 // RUN: | FileCheck -check-prefix=MIPS-MFPXX %s 184 // MIPS-MFPXX: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mfpxx" 185 // 186 // RUN: %clang -target mips-linux-gnu -mfpxx -mfp32 -mfp64 -### \ 187 // RUN: -no-integrated-as -c %s 2>&1 \ 188 // RUN: | FileCheck -check-prefix=MIPS-MFP64 %s 189 // MIPS-MFP64: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mfp64" 190 // 191 // RUN: %clang -target mips-linux-gnu -mno-msa -mmsa -### \ 192 // RUN: -no-integrated-as -c %s 2>&1 \ 193 // RUN: | FileCheck -check-prefix=MIPS-MSA %s 194 // MIPS-MSA: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mmsa" 195 // 196 // RUN: %clang -target mips-linux-gnu -mmsa -mno-msa -### \ 197 // RUN: -no-integrated-as -c %s 2>&1 \ 198 // RUN: | FileCheck -check-prefix=MIPS-NMSA %s 199 // MIPS-NMSA: as{{(.exe)?}}" 200 // MIPS-NMSA-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-mmsa" 201 // 202 // We've already tested MIPS32r2 and MIPS64r2 thoroughly. Do minimal tests on 203 // the remaining CPU's since it was possible to pass on a -mabi with no value 204 // when the CPU name is absent from a StringSwitch in getMipsCPUAndABI() 205 // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips1 \ 206 // RUN: 2>&1 | FileCheck -check-prefix=MIPS1-EB-AS %s 207 // MIPS1-EB-AS: as{{(.exe)?}}" "-march" "mips1" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 208 // MIPS1-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" 209 // 210 // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips2 \ 211 // RUN: 2>&1 | FileCheck -check-prefix=MIPS2-EB-AS %s 212 // MIPS2-EB-AS: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 213 // MIPS2-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" 214 // 215 // RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips3 \ 216 // RUN: 2>&1 | FileCheck -check-prefix=MIPS3-EB-AS %s 217 // MIPS3-EB-AS: as{{(.exe)?}}" "-march" "mips3" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" 218 // 219 // RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips4 \ 220 // RUN: 2>&1 | FileCheck -check-prefix=MIPS4-EB-AS %s 221 // MIPS4-EB-AS: as{{(.exe)?}}" "-march" "mips4" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" 222 // 223 // RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips5 \ 224 // RUN: 2>&1 | FileCheck -check-prefix=MIPS5-EB-AS %s 225 // MIPS5-EB-AS: as{{(.exe)?}}" "-march" "mips5" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" 226 // 227 // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips32 \ 228 // RUN: 2>&1 | FileCheck -check-prefix=MIPS32-EB-AS %s 229 // MIPS32-EB-AS: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 230 // MIPS32-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" 231 // 232 // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips32r6 \ 233 // RUN: 2>&1 | FileCheck -check-prefix=MIPS32R6-EB-AS %s 234 // MIPS32R6-EB-AS: as{{(.exe)?}}" "-march" "mips32r6" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" 235 // MIPS32R6-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" 236 // 237 // RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips64 \ 238 // RUN: 2>&1 | FileCheck -check-prefix=MIPS64-EB-AS %s 239 // MIPS64-EB-AS: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" 240 // 241 // RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips64r6 \ 242 // RUN: 2>&1 | FileCheck -check-prefix=MIPS64R6-EB-AS %s 243 // MIPS64R6-EB-AS: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" 244 // 245 // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -msoft-float -mhard-float -c %s 2>&1 \ 246 // RUN: | FileCheck -check-prefix=HARDFLOAT --implicit-check-not=-msoft-float %s 247 // HARDFLOAT: as{{(.exe)?}}" 248 // HARDFLOAT: -mhard-float 249 // 250 // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -mhard-float -msoft-float -c %s 2>&1 \ 251 // RUN: | FileCheck -check-prefix=SOFTFLOAT --implicit-check-not=-mhard-float %s 252 // SOFTFLOAT: as{{(.exe)?}}" 253 // SOFTFLOAT: -msoft-float 254 // 255 // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -mno-odd-spreg -modd-spreg -c %s 2>&1 \ 256 // RUN: | FileCheck -check-prefix=ODDSPREG --implicit-check-not=-mno-odd-spreg %s 257 // ODDSPREG: as{{(.exe)?}}" 258 // ODDSPREG: -modd-spreg 259 // 260 // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -modd-spreg -mno-odd-spreg -c %s 2>&1 \ 261 // RUN: | FileCheck -check-prefix=NOODDSPREG --implicit-check-not=-modd-spreg %s 262 // NOODDSPREG: as{{(.exe)?}}" 263 // NOODDSPREG: -mno-odd-spreg 264