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