1 // Check passing Mips ABI options to the backend. 2 // 3 // RUN: %clang --target=mips-linux-gnu -### -c %s 2>&1 \ 4 // RUN: | FileCheck -check-prefix=MIPS32R2-O32 %s 5 // RUN: %clang --target=mips64-linux-gnu -mips32r2 -mabi=32 -### -c %s 2>&1 \ 6 // RUN: | FileCheck -check-prefix=MIPS32R2-O32 %s 7 // MIPS32R2-O32: "-target-cpu" "mips32r2" 8 // MIPS32R2-O32: "-target-abi" "o32" 9 // 10 // RUN: %clang --target=mips64-linux-gnu -### -c %s 2>&1 \ 11 // RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s 12 // RUN: %clang --target=mips-img-linux-gnu -mips64r2 -### -c %s 2>&1 \ 13 // RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s 14 // RUN: %clang --target=mips-mti-linux-gnu -mips64r2 -### -c %s 2>&1 \ 15 // RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s 16 // RUN: %clang --target=mips-linux-gnu -mips64r2 -mabi=64 -### -c %s 2>&1 \ 17 // RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s 18 // MIPS64R2-N64: "-target-cpu" "mips64r2" 19 // MIPS64R2-N64: "-target-abi" "n64" 20 // 21 // RUN: %clang --target=mips64-linux-gnu -### -mips64r3 -c %s 2>&1 \ 22 // RUN: | FileCheck -check-prefix=MIPS64R3-N64 %s 23 // RUN: %clang --target=mips-img-linux-gnu -mips64r3 -### -c %s 2>&1 \ 24 // RUN: | FileCheck -check-prefix=MIPS64R3-N64 %s 25 // RUN: %clang --target=mips-mti-linux-gnu -mips64r3 -### -c %s 2>&1 \ 26 // RUN: | FileCheck -check-prefix=MIPS64R3-N64 %s 27 // MIPS64R3-N64: "-target-cpu" "mips64r3" 28 // MIPS64R3-N64: "-target-abi" "n64" 29 // 30 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 31 // RUN: -mabi=32 2>&1 \ 32 // RUN: | FileCheck -check-prefix=MIPS-ABI-32 %s 33 // MIPS-ABI-32: "-target-cpu" "mips32r2" 34 // MIPS-ABI-32: "-target-abi" "o32" 35 // 36 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 37 // RUN: -mabi=o32 2>&1 \ 38 // RUN: | FileCheck -check-prefix=MIPS-ABI-O32 %s 39 // MIPS-ABI-O32: "-target-cpu" "mips32r2" 40 // MIPS-ABI-O32: "-target-abi" "o32" 41 // 42 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 43 // RUN: -mabi=n32 2>&1 \ 44 // RUN: | FileCheck -check-prefix=MIPS-ABI-N32 %s 45 // MIPS-ABI-N32: "-target-cpu" "mips64r2" 46 // MIPS-ABI-N32: "-target-abi" "n32" 47 // 48 // RUN: %clang --target=mips64-linux-gnu -### -c %s \ 49 // RUN: -mabi=64 2>&1 \ 50 // RUN: | FileCheck -check-prefix=MIPS-ABI-64 %s 51 // MIPS-ABI-64: "-target-cpu" "mips64r2" 52 // MIPS-ABI-64: "-target-abi" "n64" 53 // 54 // RUN: %clang --target=mips64-linux-gnu -### -c %s \ 55 // RUN: -mabi=n64 2>&1 \ 56 // RUN: | FileCheck -check-prefix=MIPS-ABI-N64 %s 57 // MIPS-ABI-N64: "-target-cpu" "mips64r2" 58 // MIPS-ABI-N64: "-target-abi" "n64" 59 // 60 // RUN: not %clang --target=mips64-linux-gnu -c %s \ 61 // RUN: -mabi=o64 2>&1 \ 62 // RUN: | FileCheck -check-prefix=MIPS-ABI-O64 %s 63 // MIPS-ABI-O64: error: unknown target ABI 'o64' 64 // 65 // RUN: not %clang --target=mips-linux-gnu -c %s \ 66 // RUN: -mabi=unknown 2>&1 \ 67 // RUN: | FileCheck -check-prefix=MIPS-ABI-UNKNOWN %s 68 // MIPS-ABI-UNKNOWN: error: unknown target ABI 'unknown' 69 // 70 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 71 // RUN: -march=mips1 2>&1 \ 72 // RUN: | FileCheck -check-prefix=MIPS-ARCH-1 %s 73 // MIPS-ARCH-1: "-target-cpu" "mips1" 74 // MIPS-ARCH-1: "-target-abi" "o32" 75 // 76 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 77 // RUN: -march=mips2 2>&1 \ 78 // RUN: | FileCheck -check-prefix=MIPS-ARCH-2 %s 79 // MIPS-ARCH-2: "-target-cpu" "mips2" 80 // MIPS-ARCH-2: "-target-abi" "o32" 81 // 82 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 83 // RUN: -march=mips3 2>&1 \ 84 // RUN: | FileCheck -check-prefix=MIPS-ARCH-3 %s 85 // MIPS-ARCH-3: "-target-cpu" "mips3" 86 // MIPS-ARCH-3: "-target-abi" "o32" 87 // 88 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 89 // RUN: -march=mips4 2>&1 \ 90 // RUN: | FileCheck -check-prefix=MIPS-ARCH-4 %s 91 // MIPS-ARCH-4: "-target-cpu" "mips4" 92 // MIPS-ARCH-4: "-target-abi" "o32" 93 // 94 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 95 // RUN: -march=mips5 2>&1 \ 96 // RUN: | FileCheck -check-prefix=MIPS-ARCH-5 %s 97 // MIPS-ARCH-5: "-target-cpu" "mips5" 98 // MIPS-ARCH-5: "-target-abi" "o32" 99 // 100 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 101 // RUN: -march=mips32 2>&1 \ 102 // RUN: | FileCheck -check-prefix=MIPS-ARCH-32 %s 103 // MIPS-ARCH-32: "-target-cpu" "mips32" 104 // MIPS-ARCH-32: "-target-abi" "o32" 105 // 106 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 107 // RUN: -march=mips32r2 2>&1 \ 108 // RUN: | FileCheck -check-prefix=MIPS-ARCH-32R2 %s 109 // MIPS-ARCH-32R2: "-target-cpu" "mips32r2" 110 // MIPS-ARCH-32R2: "-target-abi" "o32" 111 // 112 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 113 // RUN: -march=p5600 2>&1 \ 114 // RUN: | FileCheck -check-prefix=MIPS-ARCH-P5600 %s 115 // MIPS-ARCH-P5600: "-target-cpu" "p5600" 116 // MIPS-ARCH-P5600: "-target-abi" "o32" 117 // 118 // RUN: not %clang --target=mips-linux-gnu -c %s \ 119 // RUN: -march=p5600 -mabi=64 2>&1 \ 120 // RUN: | FileCheck -check-prefix=MIPS-ARCH-P5600-N64 %s 121 // MIPS-ARCH-P5600-N64: error: ABI 'n64' is not supported on CPU 'p5600' 122 // 123 // RUN: %clang --target=mips-linux-gnu -### -c %s \ 124 // RUN: -march=mips64 2>&1 \ 125 // RUN: | FileCheck -check-prefix=MIPS-ARCH-3264 %s 126 // MIPS-ARCH-3264: "-target-cpu" "mips64" 127 // MIPS-ARCH-3264: "-target-abi" "o32" 128 // 129 // RUN: %clang --target=mips64-linux-gnu -### -c %s \ 130 // RUN: -march=mips64 2>&1 \ 131 // RUN: | FileCheck -check-prefix=MIPS-ARCH-64 %s 132 // MIPS-ARCH-64: "-target-cpu" "mips64" 133 // MIPS-ARCH-64: "-target-abi" "n64" 134 // 135 // RUN: %clang --target=mips64-linux-gnu -### -c %s \ 136 // RUN: -march=mips64r2 2>&1 \ 137 // RUN: | FileCheck -check-prefix=MIPS-ARCH-64R2 %s 138 // MIPS-ARCH-64R2: "-target-cpu" "mips64r2" 139 // MIPS-ARCH-64R2: "-target-abi" "n64" 140 // 141 // RUN: %clang --target=mips64-linux-gnu -### -c %s \ 142 // RUN: -march=octeon 2>&1 \ 143 // RUN: | FileCheck -check-prefix=MIPS-ARCH-OCTEON %s 144 // MIPS-ARCH-OCTEON: "-target-cpu" "octeon" 145 // MIPS-ARCH-OCTEON: "-target-abi" "n64" 146 // 147 // RUN: %clang --target=mips64-linux-gnu -### -c %s \ 148 // RUN: -march=octeon+ 2>&1 \ 149 // RUN: | FileCheck -check-prefix=MIPS-ARCH-OCTEONP %s 150 // MIPS-ARCH-OCTEONP: "-target-cpu" "octeon+" 151 // MIPS-ARCH-OCTEONP: "-target-abi" "n64" 152 // 153 // RUN: not %clang --target=mips64-linux-gnu -c %s \ 154 // RUN: -march=mips32 2>&1 \ 155 // RUN: | FileCheck -check-prefix=MIPS-ARCH-6432 %s 156 // MIPS-ARCH-6432: error: ABI 'n64' is not supported on CPU 'mips32' 157 // 158 // RUN: not %clang --target=mips-linux-gnu -c %s \ 159 // RUN: -march=unknown 2>&1 \ 160 // RUN: | FileCheck -check-prefix=MIPS-ARCH-UNKNOWN %s 161 // MIPS-ARCH-UNKNOWN: error: unknown target CPU 'unknown' 162 163 // Check adjusting of target triple accordingly to `-mabi` option. 164 // RUN: %clang --target=mips64-linux-gnuabi64 -mabi=32 -### %s 2>&1 \ 165 // RUN: | FileCheck -check-prefix=TARGET-O32 %s 166 // TARGET-O32: "-triple" "mips-unknown-linux-gnu" 167 // TARGET-O32: "-target-cpu" "mips32r2" 168 // TARGET-O32: "-target-abi" "o32" 169 // TARGET-O32: ld{{(.exe)?}}" 170 // TARGET-O32: "-m" "elf32btsmip" 171 172 // RUN: %clang --target=mips-linux-gnu -mabi=n32 -### %s 2>&1 \ 173 // RUN: | FileCheck -check-prefix=TARGET-N32 %s 174 // TARGET-N32: "-triple" "mips64-unknown-linux-gnuabin32" 175 // TARGET-N32: "-target-cpu" "mips64r2" 176 // TARGET-N32: "-target-abi" "n32" 177 // TARGET-N32: ld{{(.exe)?}}" 178 // TARGET-N32: "-m" "elf32btsmipn32" 179 180 // RUN: %clang --target=mips-linux-gnu -mabi=64 -### %s 2>&1 \ 181 // RUN: | FileCheck -check-prefix=TARGET-N64 %s 182 // TARGET-N64: "-triple" "mips64-unknown-linux-gnuabi64" 183 // TARGET-N64: "-target-cpu" "mips64r2" 184 // TARGET-N64: "-target-abi" "n64" 185 // TARGET-N64: ld{{(.exe)?}}" 186 // TARGET-N64: "-m" "elf64btsmip" 187