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