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=MIPS-DEF %s
5 // MIPS-DEF: "-target-cpu" "mips32r2"
6 // MIPS-DEF: "-target-abi" "o32"
7 //
8 // RUN: %clang -target mips64-linux-gnu -### -c %s 2>&1 \
9 // RUN:   | FileCheck -check-prefix=MIPS64-DEF %s
10 // MIPS64-DEF: "-target-cpu" "mips64r2"
11 // MIPS64-DEF: "-target-abi" "n64"
12 //
13 // RUN: %clang -target mips-linux-gnu -### -c %s \
14 // RUN:        -mabi=32 2>&1 \
15 // RUN:   | FileCheck -check-prefix=MIPS-ABI-32 %s
16 // MIPS-ABI-32: "-target-cpu" "mips32r2"
17 // MIPS-ABI-32: "-target-abi" "o32"
18 //
19 // RUN: %clang -target mips-linux-gnu -### -c %s \
20 // RUN:        -mabi=o32 2>&1 \
21 // RUN:   | FileCheck -check-prefix=MIPS-ABI-O32 %s
22 // MIPS-ABI-O32: "-target-cpu" "mips32r2"
23 // MIPS-ABI-O32: "-target-abi" "o32"
24 //
25 // RUN: %clang -target mips-linux-gnu -### -c %s \
26 // RUN:        -mabi=n32 2>&1 \
27 // RUN:   | FileCheck -check-prefix=MIPS-ABI-N32 %s
28 // MIPS-ABI-N32: "-target-cpu" "mips64r2"
29 // MIPS-ABI-N32: "-target-abi" "n32"
30 //
31 // RUN: %clang -target mips64-linux-gnu -### -c %s \
32 // RUN:        -mabi=64 2>&1 \
33 // RUN:   | FileCheck -check-prefix=MIPS-ABI-64 %s
34 // MIPS-ABI-64: "-target-cpu" "mips64r2"
35 // MIPS-ABI-64: "-target-abi" "n64"
36 //
37 // RUN: %clang -target mips64-linux-gnu -### -c %s \
38 // RUN:        -mabi=n64 2>&1 \
39 // RUN:   | FileCheck -check-prefix=MIPS-ABI-N64 %s
40 // MIPS-ABI-N64: "-target-cpu" "mips64r2"
41 // MIPS-ABI-N64: "-target-abi" "n64"
42 //
43 // RUN: not %clang -target mips64-linux-gnu -c %s \
44 // RUN:        -mabi=o64 2>&1 \
45 // RUN:   | FileCheck -check-prefix=MIPS-ABI-O64 %s
46 // MIPS-ABI-O64: error: unknown target ABI 'o64'
47 //
48 // RUN: %clang -target mips-linux-gnu -### -c %s \
49 // RUN:        -mabi=eabi 2>&1 \
50 // RUN:   | FileCheck -check-prefix=MIPS-ABI-EABI %s
51 // MIPS-ABI-EABI: "-target-cpu" "mips32r2"
52 // MIPS-ABI-EABI: "-target-abi" "eabi"
53 //
54 // RUN: not %clang -target mips-linux-gnu -c %s \
55 // RUN:        -mabi=unknown 2>&1 \
56 // RUN:   | FileCheck -check-prefix=MIPS-ABI-UNKNOWN %s
57 // MIPS-ABI-UNKNOWN: error: unknown target ABI 'unknown'
58 //
59 // RUN: %clang -target mips-linux-gnu -### -c %s \
60 // RUN:        -march=mips1 2>&1 \
61 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-1 %s
62 // MIPS-ARCH-1: "-target-cpu" "mips1"
63 // MIPS-ARCH-1: "-target-abi" "o32"
64 //
65 // RUN: %clang -target mips-linux-gnu -### -c %s \
66 // RUN:        -march=mips2 2>&1 \
67 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-2 %s
68 // MIPS-ARCH-2: "-target-cpu" "mips2"
69 // MIPS-ARCH-2: "-target-abi" "o32"
70 //
71 // RUN: %clang -target mips-linux-gnu -### -c %s \
72 // RUN:        -march=mips3 2>&1 \
73 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-3 %s
74 // MIPS-ARCH-3: "-target-cpu" "mips3"
75 // MIPS-ARCH-3: "-target-abi" "o32"
76 //
77 // RUN: %clang -target mips-linux-gnu -### -c %s \
78 // RUN:        -march=mips4 2>&1 \
79 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-4 %s
80 // MIPS-ARCH-4: "-target-cpu" "mips4"
81 // MIPS-ARCH-4: "-target-abi" "o32"
82 //
83 // RUN: %clang -target mips-linux-gnu -### -c %s \
84 // RUN:        -march=mips5 2>&1 \
85 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-5 %s
86 // MIPS-ARCH-5: "-target-cpu" "mips5"
87 // MIPS-ARCH-5: "-target-abi" "o32"
88 //
89 // RUN: %clang -target mips-linux-gnu -### -c %s \
90 // RUN:        -march=mips32 2>&1 \
91 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-32 %s
92 // MIPS-ARCH-32: "-target-cpu" "mips32"
93 // MIPS-ARCH-32: "-target-abi" "o32"
94 //
95 // RUN: %clang -target mips-linux-gnu -### -c %s \
96 // RUN:        -march=mips32r2 2>&1 \
97 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-32R2 %s
98 // MIPS-ARCH-32R2: "-target-cpu" "mips32r2"
99 // MIPS-ARCH-32R2: "-target-abi" "o32"
100 //
101 // RUN: %clang -target mips-linux-gnu -### -c %s \
102 // RUN:        -march=p5600 2>&1 \
103 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-P5600 %s
104 // MIPS-ARCH-P5600: "-target-cpu" "p5600"
105 // MIPS-ARCH-P5600: "-target-abi" "o32"
106 //
107 // RUN: %clang -target mips-linux-gnu -### -c %s \
108 // RUN:        -march=mips64 2>&1 \
109 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-3264 %s
110 // MIPS-ARCH-3264: "-target-cpu" "mips64"
111 // MIPS-ARCH-3264: "-target-abi" "o32"
112 //
113 // RUN: %clang -target mips64-linux-gnu -### -c %s \
114 // RUN:        -march=mips64 2>&1 \
115 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-64 %s
116 // MIPS-ARCH-64: "-target-cpu" "mips64"
117 // MIPS-ARCH-64: "-target-abi" "n64"
118 //
119 // RUN: %clang -target mips64-linux-gnu -### -c %s \
120 // RUN:        -march=mips64r2 2>&1 \
121 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-64R2 %s
122 // MIPS-ARCH-64R2: "-target-cpu" "mips64r2"
123 // MIPS-ARCH-64R2: "-target-abi" "n64"
124 //
125 // RUN: %clang -target mips64-linux-gnu -### -c %s \
126 // RUN:        -march=octeon 2>&1 \
127 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-OCTEON %s
128 // MIPS-ARCH-OCTEON: "-target-cpu" "octeon"
129 // MIPS-ARCH-OCTEON: "-target-abi" "n64"
130 //
131 // RUN: not %clang -target mips64-linux-gnu -c %s \
132 // RUN:        -march=mips32 2>&1 \
133 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-6432 %s
134 // MIPS-ARCH-6432: error: unknown target CPU 'mips32'
135 //
136 // RUN: not %clang -target mips-linux-gnu -c %s \
137 // RUN:        -march=unknown 2>&1 \
138 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-UNKNOWN %s
139 // MIPS-ARCH-UNKNOWN: error: unknown target CPU 'unknown'
140