blob: c17a4be968934eb4e5eaf5cb97f2b075177a26aa [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 \
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//
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000013// RUN: %clang -target mips-linux-gnu -### -c %s \
14// RUN: -mabi=32 2>&1 \
15// RUN: | FileCheck -check-prefix=MIPS-ABI-32 %s
Simon Atanasyan08c165b2014-06-30 08:09:54 +000016// MIPS-ABI-32: "-target-cpu" "mips32r2"
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000017// 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
Simon Atanasyan08c165b2014-06-30 08:09:54 +000022// MIPS-ABI-O32: "-target-cpu" "mips32r2"
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000023// 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
Simon Atanasyan08c165b2014-06-30 08:09:54 +000028// MIPS-ABI-N32: "-target-cpu" "mips64r2"
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000029// 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
Simon Atanasyan08c165b2014-06-30 08:09:54 +000034// MIPS-ABI-64: "-target-cpu" "mips64r2"
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000035// 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
Simon Atanasyan08c165b2014-06-30 08:09:54 +000040// MIPS-ABI-N64: "-target-cpu" "mips64r2"
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000041// MIPS-ABI-N64: "-target-abi" "n64"
42//
Simon Atanasyan08c165b2014-06-30 08:09:54 +000043// RUN: not %clang -target mips64-linux-gnu -c %s \
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000044// RUN: -mabi=o64 2>&1 \
45// RUN: | FileCheck -check-prefix=MIPS-ABI-O64 %s
Simon Atanasyan08c165b2014-06-30 08:09:54 +000046// MIPS-ABI-O64: error: unknown target ABI 'o64'
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000047//
48// RUN: %clang -target mips-linux-gnu -### -c %s \
49// RUN: -mabi=eabi 2>&1 \
50// RUN: | FileCheck -check-prefix=MIPS-ABI-EABI %s
Simon Atanasyan08c165b2014-06-30 08:09:54 +000051// MIPS-ABI-EABI: "-target-cpu" "mips32r2"
Simon Atanasyan4938ddb2013-04-21 13:30:10 +000052// MIPS-ABI-EABI: "-target-abi" "eabi"
Simon Atanasyan08c165b2014-06-30 08:09:54 +000053//
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'
Simon Atanasyana42a84e2014-07-02 13:20:36 +000058//
59// RUN: %clang -target mips-linux-gnu -### -c %s \
60// RUN: -march=mips32 2>&1 \
61// RUN: | FileCheck -check-prefix=MIPS-ARCH-32 %s
62// MIPS-ARCH-32: "-target-cpu" "mips32"
63// MIPS-ARCH-32: "-target-abi" "o32"
64//
65// RUN: %clang -target mips-linux-gnu -### -c %s \
66// RUN: -march=mips32r2 2>&1 \
67// RUN: | FileCheck -check-prefix=MIPS-ARCH-32R2 %s
68// MIPS-ARCH-32R2: "-target-cpu" "mips32r2"
69// MIPS-ARCH-32R2: "-target-abi" "o32"
70//
71// RUN: %clang -target mips-linux-gnu -### -c %s \
72// RUN: -march=mips64 2>&1 \
73// RUN: | FileCheck -check-prefix=MIPS-ARCH-3264 %s
74// MIPS-ARCH-3264: "-target-cpu" "mips64"
75// MIPS-ARCH-3264: "-target-abi" "o32"
76//
77// RUN: %clang -target mips64-linux-gnu -### -c %s \
78// RUN: -march=mips64 2>&1 \
79// RUN: | FileCheck -check-prefix=MIPS-ARCH-64 %s
80// MIPS-ARCH-64: "-target-cpu" "mips64"
81// MIPS-ARCH-64: "-target-abi" "n64"
82//
83// RUN: %clang -target mips64-linux-gnu -### -c %s \
84// RUN: -march=mips64r2 2>&1 \
85// RUN: | FileCheck -check-prefix=MIPS-ARCH-64R2 %s
86// MIPS-ARCH-64R2: "-target-cpu" "mips64r2"
87// MIPS-ARCH-64R2: "-target-abi" "n64"
Simon Atanasyan6b3544e2014-07-03 08:31:23 +000088//
89// RUN: not %clang -target mips64-linux-gnu -c %s \
90// RUN: -march=mips32 2>&1 \
91// RUN: | FileCheck -check-prefix=MIPS-ARCH-6432 %s
92// MIPS-ARCH-6432: error: unknown target CPU 'mips32'
93//
94// RUN: not %clang -target mips-linux-gnu -c %s \
95// RUN: -march=unknown 2>&1 \
96// RUN: | FileCheck -check-prefix=MIPS-ARCH-UNKNOWN %s
97// MIPS-ARCH-UNKNOWN: error: unknown target CPU 'unknown'