Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Driver / mips-img.cpp
blob3dd3dec09cf86bb20f4ff7cdfe42908247c5d6d7
1 // REQUIRES: mips-registered-target
3 // Check frontend and linker invocations on the IMG MIPS toolchain.
4 //
5 // = Big-endian, mips32r6
6 // RUN: %clang -### %s 2>&1 \
7 // RUN: --target=mips-img-linux-gnu -mips32r6 -no-pie \
8 // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \
9 // RUN: | FileCheck --check-prefix=CHECK-BE-32R6 %s
10 // CHECK-BE-32R6: "-internal-isystem"
11 // CHECK-BE-32R6: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0"
12 // CHECK-BE-32R6: "-internal-isystem"
13 // CHECK-BE-32R6: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/mips-img-linux-gnu"
14 // CHECK-BE-32R6: "-internal-isystem"
15 // CHECK-BE-32R6: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/backward"
16 // CHECK-BE-32R6: "-internal-externc-isystem"
17 // CHECK-BE-32R6: "[[TC]]/include"
18 // CHECK-BE-32R6: "-internal-externc-isystem"
19 // CHECK-BE-32R6: "[[TC]]/../../../../sysroot/usr/include"
20 // CHECK-BE-32R6: "{{.*}}ld{{(.exe)?}}"
21 // CHECK-BE-32R6: "--sysroot=[[TC]]/../../../../sysroot"
22 // CHECK-BE-32R6: "-dynamic-linker" "/lib/ld-linux-mipsn8.so.1"
23 // CHECK-BE-32R6: "[[TC]]/../../../../sysroot/usr/lib/../lib{{/|\\\\}}crt1.o"
24 // CHECK-BE-32R6: "[[TC]]/../../../../sysroot/usr/lib/../lib{{/|\\\\}}crti.o"
25 // CHECK-BE-32R6: "[[TC]]{{/|\\\\}}crtbegin.o"
26 // CHECK-BE-32R6: "-L[[TC]]"
27 // CHECK-BE-32R6: "-L[[TC]]/../../../../mips-img-linux-gnu/lib/../lib"
28 // CHECK-BE-32R6: "-L[[TC]]/../../../../sysroot/usr/lib/../lib"
29 // CHECK-BE-32R6: "[[TC]]{{/|\\\\}}crtend.o"
30 // CHECK-BE-32R6: "[[TC]]/../../../../sysroot/usr/lib/../lib{{/|\\\\}}crtn.o"
32 // = Little-endian, mips32r6
33 // RUN: %clang -### %s 2>&1 \
34 // RUN: --target=mips-img-linux-gnu -mips32r6 -EL -no-pie \
35 // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \
36 // RUN: | FileCheck --check-prefix=CHECK-LE-32R6 %s
37 // CHECK-LE-32R6: "-internal-isystem"
38 // CHECK-LE-32R6: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0"
39 // CHECK-LE-32R6: "-internal-isystem"
40 // CHECK-LE-32R6: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/mips-img-linux-gnu/el"
41 // CHECK-LE-32R6: "-internal-isystem"
42 // CHECK-LE-32R6: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/backward"
43 // CHECK-LE-32R6: "-internal-externc-isystem"
44 // CHECK-LE-32R6: "[[TC]]/include"
45 // CHECK-LE-32R6: "-internal-externc-isystem"
46 // CHECK-LE-32R6: "[[TC]]/../../../../sysroot/usr/include"
47 // CHECK-LE-32R6: "{{.*}}ld{{(.exe)?}}"
48 // CHECK-LE-32R6: "--sysroot=[[TC]]/../../../../sysroot/el"
49 // CHECK-LE-32R6: "-dynamic-linker" "/lib/ld-linux-mipsn8.so.1"
50 // CHECK-LE-32R6: "[[TC]]/../../../../sysroot/el/usr/lib/../lib{{/|\\\\}}crt1.o"
51 // CHECK-LE-32R6: "[[TC]]/../../../../sysroot/el/usr/lib/../lib{{/|\\\\}}crti.o"
52 // CHECK-LE-32R6: "[[TC]]/el{{/|\\\\}}crtbegin.o"
53 // CHECK-LE-32R6: "-L[[TC]]/el"
54 // CHECK-LE-32R6: "-L[[TC]]/../../../../mips-img-linux-gnu/lib/../lib/el"
55 // CHECK-LE-32R6: "-L[[TC]]/../../../../sysroot/el/usr/lib/../lib"
56 // CHECK-LE-32R6: "[[TC]]/el{{/|\\\\}}crtend.o"
57 // CHECK-LE-32R6: "[[TC]]/../../../../sysroot/el/usr/lib/../lib{{/|\\\\}}crtn.o"
59 // = Big-endian, mips64r6, N32
60 // RUN: %clang -### %s 2>&1 \
61 // RUN: --target=mips64-img-linux-gnu -mips64r6 -mabi=n32 -no-pie \
62 // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \
63 // RUN: | FileCheck --check-prefix=CHECK-BE-64R6-N32 %s
64 // CHECK-BE-64R6-N32: "-internal-isystem"
65 // CHECK-BE-64R6-N32: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0"
66 // CHECK-BE-64R6-N32: "-internal-isystem"
67 // CHECK-BE-64R6-N32: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/mips-img-linux-gnu/mips64r6"
68 // CHECK-BE-64R6-N32: "-internal-isystem"
69 // CHECK-BE-64R6-N32: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/backward"
70 // CHECK-BE-64R6-N32: "-internal-externc-isystem"
71 // CHECK-BE-64R6-N32: "[[TC]]/include"
72 // CHECK-BE-64R6-N32: "-internal-externc-isystem"
73 // CHECK-BE-64R6-N32: "[[TC]]/../../../../sysroot/usr/include"
74 // CHECK-BE-64R6-N32: "{{.*}}ld{{(.exe)?}}"
75 // CHECK-BE-64R6-N32: "--sysroot=[[TC]]/../../../../sysroot/mips64r6"
76 // CHECK-BE-64R6-N32: "-dynamic-linker" "/lib32/ld-linux-mipsn8.so.1"
77 // CHECK-BE-64R6-N32: "[[TC]]/../../../../sysroot/mips64r6/usr/lib{{/|\\\\}}crt1.o"
78 // CHECK-BE-64R6-N32: "[[TC]]/../../../../sysroot/mips64r6/usr/lib{{/|\\\\}}crti.o"
79 // CHECK-BE-64R6-N32: "[[TC]]/mips64r6{{/|\\\\}}crtbegin.o"
80 // CHECK-BE-64R6-N32: "-L[[TC]]/mips64r6"
81 // CHECK-BE-64R6-N32: "-L[[TC]]/../../../../mips-img-linux-gnu/lib/mips64r6"
82 // CHECK-BE-64R6-N32: "-L[[TC]]/../../../../sysroot/mips64r6/usr/lib"
83 // CHECK-BE-64R6-N32: "[[TC]]/mips64r6{{/|\\\\}}crtend.o"
84 // CHECK-BE-64R6-N32: "[[TC]]/../../../../sysroot/mips64r6/usr/lib{{/|\\\\}}crtn.o"
86 // = Little-endian, mips64r6, N32
87 // RUN: %clang -### %s 2>&1 \
88 // RUN: --target=mips64-img-linux-gnu -mips64r6 -EL -mabi=n32 -no-pie \
89 // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \
90 // RUN: | FileCheck --check-prefix=CHECK-LE-64R6-N32 %s
91 // CHECK-LE-64R6-N32: "-internal-isystem"
92 // CHECK-LE-64R6-N32: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0"
93 // CHECK-LE-64R6-N32: "-internal-isystem"
94 // CHECK-LE-64R6-N32: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/mips-img-linux-gnu/mips64r6/el"
95 // CHECK-LE-64R6-N32: "-internal-isystem"
96 // CHECK-LE-64R6-N32: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/backward"
97 // CHECK-LE-64R6-N32: "-internal-externc-isystem"
98 // CHECK-LE-64R6-N32: "[[TC]]/include"
99 // CHECK-LE-64R6-N32: "-internal-externc-isystem"
100 // CHECK-LE-64R6-N32: "[[TC]]/../../../../sysroot/usr/include"
101 // CHECK-LE-64R6-N32: "{{.*}}ld{{(.exe)?}}"
102 // CHECK-LE-64R6-N32: "--sysroot=[[TC]]/../../../../sysroot/mips64r6/el"
103 // CHECK-LE-64R6-N32: "-dynamic-linker" "/lib32/ld-linux-mipsn8.so.1"
104 // CHECK-LE-64R6-N32: "[[TC]]/../../../../sysroot/mips64r6/el/usr/lib{{/|\\\\}}crt1.o"
105 // CHECK-LE-64R6-N32: "[[TC]]/../../../../sysroot/mips64r6/el/usr/lib{{/|\\\\}}crti.o"
106 // CHECK-LE-64R6-N32: "[[TC]]/mips64r6/el{{/|\\\\}}crtbegin.o"
107 // CHECK-LE-64R6-N32: "-L[[TC]]/mips64r6/el"
108 // CHECK-LE-64R6-N32: "-L[[TC]]/../../../../mips-img-linux-gnu/lib/mips64r6/el"
109 // CHECK-LE-64R6-N32: "-L[[TC]]/../../../../sysroot/mips64r6/el/usr/lib"
110 // CHECK-LE-64R6-N32: "[[TC]]/mips64r6/el{{/|\\\\}}crtend.o"
111 // CHECK-LE-64R6-N32: "[[TC]]/../../../../sysroot/mips64r6/el/usr/lib{{/|\\\\}}crtn.o"
113 // = Big-endian, mips64r6, N64
114 // RUN: %clang -### %s 2>&1 \
115 // RUN: --target=mips64-img-linux-gnu -mips64r6 -mabi=64 -no-pie \
116 // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \
117 // RUN: | FileCheck --check-prefix=CHECK-BE-64R6-N64 %s
118 // CHECK-BE-64R6-N64: "-internal-isystem"
119 // CHECK-BE-64R6-N64: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0"
120 // CHECK-BE-64R6-N64: "-internal-isystem"
121 // CHECK-BE-64R6-N64: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/mips-img-linux-gnu/mips64r6/64"
122 // CHECK-BE-64R6-N64: "-internal-isystem"
123 // CHECK-BE-64R6-N64: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/backward"
124 // CHECK-BE-64R6-N64: "-internal-externc-isystem"
125 // CHECK-BE-64R6-N64: "[[TC]]/include"
126 // CHECK-BE-64R6-N64: "-internal-externc-isystem"
127 // CHECK-BE-64R6-N64: "[[TC]]/../../../../sysroot/usr/include"
128 // CHECK-BE-64R6-N64: "{{.*}}ld{{(.exe)?}}"
129 // CHECK-BE-64R6-N64: "--sysroot=[[TC]]/../../../../sysroot/mips64r6/64"
130 // CHECK-BE-64R6-N64: "-dynamic-linker" "/lib64/ld-linux-mipsn8.so.1"
131 // CHECK-BE-64R6-N64: "[[TC]]/../../../../sysroot/mips64r6/64/usr/lib{{/|\\\\}}crt1.o"
132 // CHECK-BE-64R6-N64: "[[TC]]/../../../../sysroot/mips64r6/64/usr/lib{{/|\\\\}}crti.o"
133 // CHECK-BE-64R6-N64: "[[TC]]/mips64r6/64{{/|\\\\}}crtbegin.o"
134 // CHECK-BE-64R6-N64: "-L[[TC]]/mips64r6/64"
135 // CHECK-BE-64R6-N64: "-L[[TC]]/../../../../mips-img-linux-gnu/lib/mips64r6/64"
136 // CHECK-BE-64R6-N64: "-L[[TC]]/../../../../sysroot/mips64r6/64/usr/lib"
137 // CHECK-BE-64R6-N64: "[[TC]]/mips64r6/64{{/|\\\\}}crtend.o"
138 // CHECK-BE-64R6-N64: "[[TC]]/../../../../sysroot/mips64r6/64/usr/lib{{/|\\\\}}crtn.o"
140 // = Little-endian, mips64r6, N64
141 // RUN: %clang -### %s 2>&1 \
142 // RUN: --target=mips64-img-linux-gnu -mips64r6 -EL -mabi=64 -no-pie \
143 // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \
144 // RUN: | FileCheck --check-prefix=CHECK-LE-64R6-N64 %s
145 // CHECK-LE-64R6-N64: "-internal-isystem"
146 // CHECK-LE-64R6-N64: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0"
147 // CHECK-LE-64R6-N64: "-internal-isystem"
148 // CHECK-LE-64R6-N64: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/mips-img-linux-gnu/mips64r6/64/el"
149 // CHECK-LE-64R6-N64: "-internal-isystem"
150 // CHECK-LE-64R6-N64: "[[TC]]/../../../../mips-img-linux-gnu/include/c++/4.9.0/backward"
151 // CHECK-LE-64R6-N64: "-internal-externc-isystem"
152 // CHECK-LE-64R6-N64: "[[TC]]/include"
153 // CHECK-LE-64R6-N64: "-internal-externc-isystem"
154 // CHECK-LE-64R6-N64: "[[TC]]/../../../../sysroot/usr/include"
155 // CHECK-LE-64R6-N64: "{{.*}}ld{{(.exe)?}}"
156 // CHECK-LE-64R6-N64: "--sysroot=[[TC]]/../../../../sysroot/mips64r6/64/el"
157 // CHECK-LE-64R6-N64: "-dynamic-linker" "/lib64/ld-linux-mipsn8.so.1"
158 // CHECK-LE-64R6-N64: "[[TC]]/../../../../sysroot/mips64r6/64/el/usr/lib{{/|\\\\}}crt1.o"
159 // CHECK-LE-64R6-N64: "[[TC]]/../../../../sysroot/mips64r6/64/el/usr/lib{{/|\\\\}}crti.o"
160 // CHECK-LE-64R6-N64: "[[TC]]/mips64r6/64/el{{/|\\\\}}crtbegin.o"
161 // CHECK-LE-64R6-N64: "-L[[TC]]/mips64r6/64/el"
162 // CHECK-LE-64R6-N64: "-L[[TC]]/../../../../mips-img-linux-gnu/lib/mips64r6/64/el"
163 // CHECK-LE-64R6-N64: "-L[[TC]]/../../../../sysroot/mips64r6/64/el/usr/lib"
164 // CHECK-LE-64R6-N64: "[[TC]]/mips64r6/64/el{{/|\\\\}}crtend.o"
165 // CHECK-LE-64R6-N64: "[[TC]]/../../../../sysroot/mips64r6/64/el/usr/lib{{/|\\\\}}crtn.o"