blob: 8e3f7c0cd12c39a1396e15ea3f3cdb4c7d3eb95d [file] [log] [blame]
Simon Atanasyan4938ddb2013-04-21 13:30:10 +00001// Check passing Mips ABI options to the backend.
2//
Simon Atanasyana42a84e2014-07-02 13:20:36 +00003// RUN: %clang -target mips-linux-gnu -### -c %s 2>&1 \
Daniel Sanders32b2d6b2016-06-14 08:58:50 +00004// 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// FIXME: This is a valid combination of options but we reject it at the moment
11// because the backend can't handle it.
12// RUN: not %clang -target mips-linux-gnu -c %s \
13// RUN: -march=mips64r2 -mabi=32 2>&1 \
14// RUN: | FileCheck -check-prefix=MIPS64R2-O32 %s
15// MIPS64R2-O32: error: ABI 'o32' is not supported on CPU 'mips64r2'
Simon Atanasyana42a84e2014-07-02 13:20:36 +000016//
17// RUN: %clang -target mips64-linux-gnu -### -c %s 2>&1 \
Daniel Sanders0ca86fe2016-06-06 12:02:21 +000018// RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s
19// RUN: %clang -target mips-img-linux-gnu -mips64r2 -### -c %s 2>&1 \
20// RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s
21// RUN: %clang -target mips-mti-linux-gnu -mips64r2 -### -c %s 2>&1 \
22// RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s
Daniel Sanders32b2d6b2016-06-14 08:58:50 +000023// RUN: %clang -target mips-linux-gnu -mips64r2 -mabi=64 -### -c %s 2>&1 \
24// RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s
Daniel Sanders0ca86fe2016-06-06 12:02:21 +000025// MIPS64R2-N64: "-target-cpu" "mips64r2"
26// MIPS64R2-N64: "-target-abi" "n64"
27//
28// RUN: %clang -target mips64-linux-gnu -### -mips64r3 -c %s 2>&1 \
29// RUN: | FileCheck -check-prefix=MIPS64R3-N64 %s
30// RUN: %clang -target mips-img-linux-gnu -mips64r3 -### -c %s 2>&1 \
31// RUN: | FileCheck -check-prefix=MIPS64R3-N64 %s
32// RUN: %clang -target mips-mti-linux-gnu -mips64r3 -### -c %s 2>&1 \
33// RUN: | FileCheck -check-prefix=MIPS64R3-N64 %s
34// MIPS64R3-N64: "-target-cpu" "mips64r3"
35// MIPS64R3-N64: "-target-abi" "n64"
Simon Atanasyana42a84e2014-07-02 13:20:36 +000036//
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000037// RUN: %clang -target mips-linux-gnu -### -c %s \
38// RUN: -mabi=32 2>&1 \
39// RUN: | FileCheck -check-prefix=MIPS-ABI-32 %s
Simon Atanasyan08c165b2014-06-30 08:09:54 +000040// MIPS-ABI-32: "-target-cpu" "mips32r2"
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000041// MIPS-ABI-32: "-target-abi" "o32"
42//
43// RUN: %clang -target mips-linux-gnu -### -c %s \
44// RUN: -mabi=o32 2>&1 \
45// RUN: | FileCheck -check-prefix=MIPS-ABI-O32 %s
Simon Atanasyan08c165b2014-06-30 08:09:54 +000046// MIPS-ABI-O32: "-target-cpu" "mips32r2"
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000047// MIPS-ABI-O32: "-target-abi" "o32"
48//
49// RUN: %clang -target mips-linux-gnu -### -c %s \
50// RUN: -mabi=n32 2>&1 \
51// RUN: | FileCheck -check-prefix=MIPS-ABI-N32 %s
Simon Atanasyan08c165b2014-06-30 08:09:54 +000052// MIPS-ABI-N32: "-target-cpu" "mips64r2"
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000053// MIPS-ABI-N32: "-target-abi" "n32"
54//
55// RUN: %clang -target mips64-linux-gnu -### -c %s \
56// RUN: -mabi=64 2>&1 \
57// RUN: | FileCheck -check-prefix=MIPS-ABI-64 %s
Simon Atanasyan08c165b2014-06-30 08:09:54 +000058// MIPS-ABI-64: "-target-cpu" "mips64r2"
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000059// MIPS-ABI-64: "-target-abi" "n64"
60//
61// RUN: %clang -target mips64-linux-gnu -### -c %s \
62// RUN: -mabi=n64 2>&1 \
63// RUN: | FileCheck -check-prefix=MIPS-ABI-N64 %s
Simon Atanasyan08c165b2014-06-30 08:09:54 +000064// MIPS-ABI-N64: "-target-cpu" "mips64r2"
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000065// MIPS-ABI-N64: "-target-abi" "n64"
66//
Simon Atanasyan08c165b2014-06-30 08:09:54 +000067// RUN: not %clang -target mips64-linux-gnu -c %s \
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000068// RUN: -mabi=o64 2>&1 \
69// RUN: | FileCheck -check-prefix=MIPS-ABI-O64 %s
Simon Atanasyan08c165b2014-06-30 08:09:54 +000070// MIPS-ABI-O64: error: unknown target ABI 'o64'
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000071//
Simon Atanasyan08c165b2014-06-30 08:09:54 +000072// RUN: not %clang -target mips-linux-gnu -c %s \
73// RUN: -mabi=unknown 2>&1 \
74// RUN: | FileCheck -check-prefix=MIPS-ABI-UNKNOWN %s
75// MIPS-ABI-UNKNOWN: error: unknown target ABI 'unknown'
Simon Atanasyana42a84e2014-07-02 13:20:36 +000076//
77// RUN: %clang -target mips-linux-gnu -### -c %s \
Simon Atanasyan26610c52014-07-04 12:36:56 +000078// RUN: -march=mips1 2>&1 \
79// RUN: | FileCheck -check-prefix=MIPS-ARCH-1 %s
80// MIPS-ARCH-1: "-target-cpu" "mips1"
81// MIPS-ARCH-1: "-target-abi" "o32"
82//
83// RUN: %clang -target mips-linux-gnu -### -c %s \
84// RUN: -march=mips2 2>&1 \
85// RUN: | FileCheck -check-prefix=MIPS-ARCH-2 %s
86// MIPS-ARCH-2: "-target-cpu" "mips2"
87// MIPS-ARCH-2: "-target-abi" "o32"
88//
89// RUN: %clang -target mips-linux-gnu -### -c %s \
90// RUN: -march=mips3 2>&1 \
91// RUN: | FileCheck -check-prefix=MIPS-ARCH-3 %s
92// MIPS-ARCH-3: "-target-cpu" "mips3"
93// MIPS-ARCH-3: "-target-abi" "o32"
94//
95// RUN: %clang -target mips-linux-gnu -### -c %s \
96// RUN: -march=mips4 2>&1 \
97// RUN: | FileCheck -check-prefix=MIPS-ARCH-4 %s
98// MIPS-ARCH-4: "-target-cpu" "mips4"
99// MIPS-ARCH-4: "-target-abi" "o32"
100//
101// RUN: %clang -target mips-linux-gnu -### -c %s \
102// RUN: -march=mips5 2>&1 \
103// RUN: | FileCheck -check-prefix=MIPS-ARCH-5 %s
104// MIPS-ARCH-5: "-target-cpu" "mips5"
105// MIPS-ARCH-5: "-target-abi" "o32"
106//
107// RUN: %clang -target mips-linux-gnu -### -c %s \
Simon Atanasyana42a84e2014-07-02 13:20:36 +0000108// RUN: -march=mips32 2>&1 \
109// RUN: | FileCheck -check-prefix=MIPS-ARCH-32 %s
110// MIPS-ARCH-32: "-target-cpu" "mips32"
111// MIPS-ARCH-32: "-target-abi" "o32"
112//
113// RUN: %clang -target mips-linux-gnu -### -c %s \
114// RUN: -march=mips32r2 2>&1 \
115// RUN: | FileCheck -check-prefix=MIPS-ARCH-32R2 %s
116// MIPS-ARCH-32R2: "-target-cpu" "mips32r2"
117// MIPS-ARCH-32R2: "-target-abi" "o32"
118//
119// RUN: %clang -target mips-linux-gnu -### -c %s \
Daniel Sandersff952582015-10-05 12:24:30 +0000120// RUN: -march=p5600 2>&1 \
121// RUN: | FileCheck -check-prefix=MIPS-ARCH-P5600 %s
122// MIPS-ARCH-P5600: "-target-cpu" "p5600"
123// MIPS-ARCH-P5600: "-target-abi" "o32"
124//
Daniel Sanders28d86372016-06-06 09:47:32 +0000125// RUN: not %clang -target mips-linux-gnu -c %s \
126// RUN: -march=p5600 -mabi=64 2>&1 \
127// RUN: | FileCheck -check-prefix=MIPS-ARCH-P5600-N64 %s
Daniel Sanders32b2d6b2016-06-14 08:58:50 +0000128// MIPS-ARCH-P5600-N64: error: ABI 'n64' is not supported on CPU 'p5600'
Daniel Sanders28d86372016-06-06 09:47:32 +0000129//
Daniel Sandersff952582015-10-05 12:24:30 +0000130// RUN: %clang -target mips-linux-gnu -### -c %s \
Simon Atanasyana42a84e2014-07-02 13:20:36 +0000131// RUN: -march=mips64 2>&1 \
132// RUN: | FileCheck -check-prefix=MIPS-ARCH-3264 %s
133// MIPS-ARCH-3264: "-target-cpu" "mips64"
134// MIPS-ARCH-3264: "-target-abi" "o32"
135//
136// RUN: %clang -target mips64-linux-gnu -### -c %s \
137// RUN: -march=mips64 2>&1 \
138// RUN: | FileCheck -check-prefix=MIPS-ARCH-64 %s
139// MIPS-ARCH-64: "-target-cpu" "mips64"
140// MIPS-ARCH-64: "-target-abi" "n64"
141//
142// RUN: %clang -target mips64-linux-gnu -### -c %s \
143// RUN: -march=mips64r2 2>&1 \
144// RUN: | FileCheck -check-prefix=MIPS-ARCH-64R2 %s
145// MIPS-ARCH-64R2: "-target-cpu" "mips64r2"
146// MIPS-ARCH-64R2: "-target-abi" "n64"
Simon Atanasyan6b3544e2014-07-03 08:31:23 +0000147//
Simon Atanasyan4e16a422014-07-04 12:37:04 +0000148// RUN: %clang -target mips64-linux-gnu -### -c %s \
149// RUN: -march=octeon 2>&1 \
150// RUN: | FileCheck -check-prefix=MIPS-ARCH-OCTEON %s
151// MIPS-ARCH-OCTEON: "-target-cpu" "octeon"
152// MIPS-ARCH-OCTEON: "-target-abi" "n64"
153//
Simon Atanasyan6b3544e2014-07-03 08:31:23 +0000154// RUN: not %clang -target mips64-linux-gnu -c %s \
155// RUN: -march=mips32 2>&1 \
156// RUN: | FileCheck -check-prefix=MIPS-ARCH-6432 %s
Daniel Sanders32b2d6b2016-06-14 08:58:50 +0000157// MIPS-ARCH-6432: error: ABI 'n64' is not supported on CPU 'mips32'
Simon Atanasyan6b3544e2014-07-03 08:31:23 +0000158//
159// RUN: not %clang -target mips-linux-gnu -c %s \
160// RUN: -march=unknown 2>&1 \
161// RUN: | FileCheck -check-prefix=MIPS-ARCH-UNKNOWN %s
162// MIPS-ARCH-UNKNOWN: error: unknown target CPU 'unknown'