• Home
  • Raw
  • Download

Lines Matching +full:- +full:t

1 //===----------- Triple.cpp - Triple unit tests ---------------------------===//
8 //===----------------------------------------------------------------------===//
18 Triple T; in TEST() local
20 T = Triple(""); in TEST()
21 EXPECT_EQ("", T.getArchName().str()); in TEST()
22 EXPECT_EQ("", T.getVendorName().str()); in TEST()
23 EXPECT_EQ("", T.getOSName().str()); in TEST()
24 EXPECT_EQ("", T.getEnvironmentName().str()); in TEST()
26 T = Triple("-"); in TEST()
27 EXPECT_EQ("", T.getArchName().str()); in TEST()
28 EXPECT_EQ("", T.getVendorName().str()); in TEST()
29 EXPECT_EQ("", T.getOSName().str()); in TEST()
30 EXPECT_EQ("", T.getEnvironmentName().str()); in TEST()
32 T = Triple("--"); in TEST()
33 EXPECT_EQ("", T.getArchName().str()); in TEST()
34 EXPECT_EQ("", T.getVendorName().str()); in TEST()
35 EXPECT_EQ("", T.getOSName().str()); in TEST()
36 EXPECT_EQ("", T.getEnvironmentName().str()); in TEST()
38 T = Triple("---"); in TEST()
39 EXPECT_EQ("", T.getArchName().str()); in TEST()
40 EXPECT_EQ("", T.getVendorName().str()); in TEST()
41 EXPECT_EQ("", T.getOSName().str()); in TEST()
42 EXPECT_EQ("", T.getEnvironmentName().str()); in TEST()
44 T = Triple("----"); in TEST()
45 EXPECT_EQ("", T.getArchName().str()); in TEST()
46 EXPECT_EQ("", T.getVendorName().str()); in TEST()
47 EXPECT_EQ("", T.getOSName().str()); in TEST()
48 EXPECT_EQ("-", T.getEnvironmentName().str()); in TEST()
50 T = Triple("a"); in TEST()
51 EXPECT_EQ("a", T.getArchName().str()); in TEST()
52 EXPECT_EQ("", T.getVendorName().str()); in TEST()
53 EXPECT_EQ("", T.getOSName().str()); in TEST()
54 EXPECT_EQ("", T.getEnvironmentName().str()); in TEST()
56 T = Triple("a-b"); in TEST()
57 EXPECT_EQ("a", T.getArchName().str()); in TEST()
58 EXPECT_EQ("b", T.getVendorName().str()); in TEST()
59 EXPECT_EQ("", T.getOSName().str()); in TEST()
60 EXPECT_EQ("", T.getEnvironmentName().str()); in TEST()
62 T = Triple("a-b-c"); in TEST()
63 EXPECT_EQ("a", T.getArchName().str()); in TEST()
64 EXPECT_EQ("b", T.getVendorName().str()); in TEST()
65 EXPECT_EQ("c", T.getOSName().str()); in TEST()
66 EXPECT_EQ("", T.getEnvironmentName().str()); in TEST()
68 T = Triple("a-b-c-d"); in TEST()
69 EXPECT_EQ("a", T.getArchName().str()); in TEST()
70 EXPECT_EQ("b", T.getVendorName().str()); in TEST()
71 EXPECT_EQ("c", T.getOSName().str()); in TEST()
72 EXPECT_EQ("d", T.getEnvironmentName().str()); in TEST()
76 Triple T; in TEST() local
78 T = Triple("i386-apple-darwin"); in TEST()
79 EXPECT_EQ(Triple::x86, T.getArch()); in TEST()
80 EXPECT_EQ(Triple::Apple, T.getVendor()); in TEST()
81 EXPECT_EQ(Triple::Darwin, T.getOS()); in TEST()
82 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
84 T = Triple("i386-pc-elfiamcu"); in TEST()
85 EXPECT_EQ(Triple::x86, T.getArch()); in TEST()
86 EXPECT_EQ(Triple::PC, T.getVendor()); in TEST()
87 EXPECT_EQ(Triple::ELFIAMCU, T.getOS()); in TEST()
88 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
90 T = Triple("x86_64-pc-linux-gnu"); in TEST()
91 EXPECT_EQ(Triple::x86_64, T.getArch()); in TEST()
92 EXPECT_EQ(Triple::PC, T.getVendor()); in TEST()
93 EXPECT_EQ(Triple::Linux, T.getOS()); in TEST()
94 EXPECT_EQ(Triple::GNU, T.getEnvironment()); in TEST()
96 T = Triple("x86_64-pc-linux-musl"); in TEST()
97 EXPECT_EQ(Triple::x86_64, T.getArch()); in TEST()
98 EXPECT_EQ(Triple::PC, T.getVendor()); in TEST()
99 EXPECT_EQ(Triple::Linux, T.getOS()); in TEST()
100 EXPECT_EQ(Triple::Musl, T.getEnvironment()); in TEST()
102 T = Triple("powerpc-bgp-linux"); in TEST()
103 EXPECT_EQ(Triple::ppc, T.getArch()); in TEST()
104 EXPECT_EQ(Triple::BGP, T.getVendor()); in TEST()
105 EXPECT_EQ(Triple::Linux, T.getOS()); in TEST()
106 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
108 T = Triple("powerpc-bgp-cnk"); in TEST()
109 EXPECT_EQ(Triple::ppc, T.getArch()); in TEST()
110 EXPECT_EQ(Triple::BGP, T.getVendor()); in TEST()
111 EXPECT_EQ(Triple::CNK, T.getOS()); in TEST()
112 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
114 T = Triple("powerpc64-bgq-linux"); in TEST()
115 EXPECT_EQ(Triple::ppc64, T.getArch()); in TEST()
116 EXPECT_EQ(Triple::BGQ, T.getVendor()); in TEST()
117 EXPECT_EQ(Triple::Linux, T.getOS()); in TEST()
118 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
120 T = Triple("powerpc-ibm-aix"); in TEST()
121 EXPECT_EQ(Triple::ppc, T.getArch()); in TEST()
122 EXPECT_EQ(Triple::IBM, T.getVendor()); in TEST()
123 EXPECT_EQ(Triple::AIX, T.getOS()); in TEST()
124 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
126 T = Triple("powerpc64-ibm-aix"); in TEST()
127 EXPECT_EQ(Triple::ppc64, T.getArch()); in TEST()
128 EXPECT_EQ(Triple::IBM, T.getVendor()); in TEST()
129 EXPECT_EQ(Triple::AIX, T.getOS()); in TEST()
130 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
132 T = Triple("powerpc-dunno-notsure"); in TEST()
133 EXPECT_EQ(Triple::ppc, T.getArch()); in TEST()
134 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
135 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
136 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
138 T = Triple("arm-none-none-eabi"); in TEST()
139 EXPECT_EQ(Triple::arm, T.getArch()); in TEST()
140 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
141 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
142 EXPECT_EQ(Triple::EABI, T.getEnvironment()); in TEST()
144 T = Triple("arm-none-linux-musleabi"); in TEST()
145 EXPECT_EQ(Triple::arm, T.getArch()); in TEST()
146 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
147 EXPECT_EQ(Triple::Linux, T.getOS()); in TEST()
148 EXPECT_EQ(Triple::MuslEABI, T.getEnvironment()); in TEST()
150 T = Triple("armv6hl-none-linux-gnueabi"); in TEST()
151 EXPECT_EQ(Triple::arm, T.getArch()); in TEST()
152 EXPECT_EQ(Triple::Linux, T.getOS()); in TEST()
153 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
154 EXPECT_EQ(Triple::GNUEABI, T.getEnvironment()); in TEST()
156 T = Triple("armv7hl-none-linux-gnueabi"); in TEST()
157 EXPECT_EQ(Triple::arm, T.getArch()); in TEST()
158 EXPECT_EQ(Triple::Linux, T.getOS()); in TEST()
159 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
160 EXPECT_EQ(Triple::GNUEABI, T.getEnvironment()); in TEST()
162 T = Triple("amdil-unknown-unknown"); in TEST()
163 EXPECT_EQ(Triple::amdil, T.getArch()); in TEST()
164 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
165 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
167 T = Triple("amdil64-unknown-unknown"); in TEST()
168 EXPECT_EQ(Triple::amdil64, T.getArch()); in TEST()
169 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
170 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
172 T = Triple("hsail-unknown-unknown"); in TEST()
173 EXPECT_EQ(Triple::hsail, T.getArch()); in TEST()
174 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
175 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
177 T = Triple("hsail64-unknown-unknown"); in TEST()
178 EXPECT_EQ(Triple::hsail64, T.getArch()); in TEST()
179 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
180 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
182 T = Triple("sparcel-unknown-unknown"); in TEST()
183 EXPECT_EQ(Triple::sparcel, T.getArch()); in TEST()
184 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
185 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
187 T = Triple("spir-unknown-unknown"); in TEST()
188 EXPECT_EQ(Triple::spir, T.getArch()); in TEST()
189 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
190 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
192 T = Triple("spir64-unknown-unknown"); in TEST()
193 EXPECT_EQ(Triple::spir64, T.getArch()); in TEST()
194 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
195 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
197 T = Triple("x86_64-unknown-cloudabi"); in TEST()
198 EXPECT_EQ(Triple::x86_64, T.getArch()); in TEST()
199 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
200 EXPECT_EQ(Triple::CloudABI, T.getOS()); in TEST()
201 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
203 T = Triple("wasm32-unknown-unknown"); in TEST()
204 EXPECT_EQ(Triple::wasm32, T.getArch()); in TEST()
205 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
206 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
207 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
209 T = Triple("wasm64-unknown-unknown"); in TEST()
210 EXPECT_EQ(Triple::wasm64, T.getArch()); in TEST()
211 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
212 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
213 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
215 T = Triple("avr-unknown-unknown"); in TEST()
216 EXPECT_EQ(Triple::avr, T.getArch()); in TEST()
217 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
218 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
219 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
221 T = Triple("avr"); in TEST()
222 EXPECT_EQ(Triple::avr, T.getArch()); in TEST()
223 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
224 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
225 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
227 T = Triple("lanai-unknown-unknown"); in TEST()
228 EXPECT_EQ(Triple::lanai, T.getArch()); in TEST()
229 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
230 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
231 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
233 T = Triple("lanai"); in TEST()
234 EXPECT_EQ(Triple::lanai, T.getArch()); in TEST()
235 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
236 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
237 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
239 T = Triple("amdgcn-mesa-mesa3d"); in TEST()
240 EXPECT_EQ(Triple::amdgcn, T.getArch()); in TEST()
241 EXPECT_EQ(Triple::Mesa, T.getVendor()); in TEST()
242 EXPECT_EQ(Triple::Mesa3D, T.getOS()); in TEST()
243 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
245 T = Triple("amdgcn-amd-amdhsa"); in TEST()
246 EXPECT_EQ(Triple::amdgcn, T.getArch()); in TEST()
247 EXPECT_EQ(Triple::AMD, T.getVendor()); in TEST()
248 EXPECT_EQ(Triple::AMDHSA, T.getOS()); in TEST()
249 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
251 T = Triple("huh"); in TEST()
252 EXPECT_EQ(Triple::UnknownArch, T.getArch()); in TEST()
256 std::string Str = A; Str += '-'; Str += B; Str += '-'; Str += C; in Join()
261 std::string Str = A; Str += '-'; Str += B; Str += '-'; Str += C; Str += '-'; in Join()
268 EXPECT_EQ("-", Triple::normalize("-")); in TEST()
269 EXPECT_EQ("--", Triple::normalize("--")); in TEST()
270 EXPECT_EQ("---", Triple::normalize("---")); in TEST()
271 EXPECT_EQ("----", Triple::normalize("----")); in TEST()
274 EXPECT_EQ("a-b", Triple::normalize("a-b")); in TEST()
275 EXPECT_EQ("a-b-c", Triple::normalize("a-b-c")); in TEST()
276 EXPECT_EQ("a-b-c-d", Triple::normalize("a-b-c-d")); in TEST()
278 EXPECT_EQ("i386-b-c", Triple::normalize("i386-b-c")); in TEST()
279 EXPECT_EQ("i386-a-c", Triple::normalize("a-i386-c")); in TEST()
280 EXPECT_EQ("i386-a-b", Triple::normalize("a-b-i386")); in TEST()
281 EXPECT_EQ("i386-a-b-c", Triple::normalize("a-b-c-i386")); in TEST()
283 EXPECT_EQ("a-pc-c", Triple::normalize("a-pc-c")); in TEST()
284 EXPECT_EQ("-pc-b-c", Triple::normalize("pc-b-c")); in TEST()
285 EXPECT_EQ("a-pc-b", Triple::normalize("a-b-pc")); in TEST()
286 EXPECT_EQ("a-pc-b-c", Triple::normalize("a-b-c-pc")); in TEST()
288 EXPECT_EQ("a-b-linux", Triple::normalize("a-b-linux")); in TEST()
289 EXPECT_EQ("--linux-b-c", Triple::normalize("linux-b-c")); in TEST()
290 EXPECT_EQ("a--linux-c", Triple::normalize("a-linux-c")); in TEST()
292 EXPECT_EQ("i386-pc-a", Triple::normalize("a-pc-i386")); in TEST()
293 EXPECT_EQ("i386-pc-", Triple::normalize("-pc-i386")); in TEST()
294 EXPECT_EQ("-pc-linux-c", Triple::normalize("linux-pc-c")); in TEST()
295 EXPECT_EQ("-pc-linux", Triple::normalize("linux-pc-")); in TEST()
298 EXPECT_EQ("-pc", Triple::normalize("pc")); in TEST()
299 EXPECT_EQ("--linux", Triple::normalize("linux")); in TEST()
301 EXPECT_EQ("x86_64--linux-gnu", Triple::normalize("x86_64-gnu-linux")); in TEST()
361 // Various real-world funky triples. The value returned by GCC's config.sub in TEST()
363 EXPECT_EQ("i386--windows-gnu", Triple::normalize("i386-mingw32")); // i386-pc-mingw32 in TEST()
364 EXPECT_EQ("x86_64--linux-gnu", Triple::normalize("x86_64-linux-gnu")); // x86_64-pc-linux-gnu in TEST()
365 EXPECT_EQ("i486--linux-gnu", Triple::normalize("i486-linux-gnu")); // i486-pc-linux-gnu in TEST()
366 EXPECT_EQ("i386-redhat-linux", Triple::normalize("i386-redhat-linux")); // i386-redhat-linux-gnu in TEST()
367 EXPECT_EQ("i686--linux", Triple::normalize("i686-linux")); // i686-pc-linux-gnu in TEST()
368 EXPECT_EQ("arm-none--eabi", Triple::normalize("arm-none-eabi")); // arm-none-eabi in TEST()
372 Triple T; in TEST() local
373 EXPECT_EQ(Triple::UnknownArch, T.getArch()); in TEST()
374 EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); in TEST()
375 EXPECT_EQ(Triple::UnknownOS, T.getOS()); in TEST()
376 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); in TEST()
378 T.setArchName("i386"); in TEST()
379 EXPECT_EQ(Triple::x86, T.getArch()); in TEST()
380 EXPECT_EQ("i386--", T.getTriple()); in TEST()
382 T.setVendorName("pc"); in TEST()
383 EXPECT_EQ(Triple::x86, T.getArch()); in TEST()
384 EXPECT_EQ(Triple::PC, T.getVendor()); in TEST()
385 EXPECT_EQ("i386-pc-", T.getTriple()); in TEST()
387 T.setOSName("linux"); in TEST()
388 EXPECT_EQ(Triple::x86, T.getArch()); in TEST()
389 EXPECT_EQ(Triple::PC, T.getVendor()); in TEST()
390 EXPECT_EQ(Triple::Linux, T.getOS()); in TEST()
391 EXPECT_EQ("i386-pc-linux", T.getTriple()); in TEST()
393 T.setEnvironmentName("gnu"); in TEST()
394 EXPECT_EQ(Triple::x86, T.getArch()); in TEST()
395 EXPECT_EQ(Triple::PC, T.getVendor()); in TEST()
396 EXPECT_EQ(Triple::Linux, T.getOS()); in TEST()
397 EXPECT_EQ("i386-pc-linux-gnu", T.getTriple()); in TEST()
399 T.setOSName("freebsd"); in TEST()
400 EXPECT_EQ(Triple::x86, T.getArch()); in TEST()
401 EXPECT_EQ(Triple::PC, T.getVendor()); in TEST()
402 EXPECT_EQ(Triple::FreeBSD, T.getOS()); in TEST()
403 EXPECT_EQ("i386-pc-freebsd-gnu", T.getTriple()); in TEST()
405 T.setOSAndEnvironmentName("darwin"); in TEST()
406 EXPECT_EQ(Triple::x86, T.getArch()); in TEST()
407 EXPECT_EQ(Triple::PC, T.getVendor()); in TEST()
408 EXPECT_EQ(Triple::Darwin, T.getOS()); in TEST()
409 EXPECT_EQ("i386-pc-darwin", T.getTriple()); in TEST()
411 T.setEnvironmentName("amdopencl"); in TEST()
412 EXPECT_EQ(Triple::AMDOpenCL, T.getEnvironment()); in TEST()
416 Triple T; in TEST() local
417 EXPECT_FALSE(T.isArch16Bit()); in TEST()
418 EXPECT_FALSE(T.isArch32Bit()); in TEST()
419 EXPECT_FALSE(T.isArch64Bit()); in TEST()
421 T.setArch(Triple::arm); in TEST()
422 EXPECT_FALSE(T.isArch16Bit()); in TEST()
423 EXPECT_TRUE(T.isArch32Bit()); in TEST()
424 EXPECT_FALSE(T.isArch64Bit()); in TEST()
426 T.setArch(Triple::hexagon); in TEST()
427 EXPECT_FALSE(T.isArch16Bit()); in TEST()
428 EXPECT_TRUE(T.isArch32Bit()); in TEST()
429 EXPECT_FALSE(T.isArch64Bit()); in TEST()
431 T.setArch(Triple::mips); in TEST()
432 EXPECT_FALSE(T.isArch16Bit()); in TEST()
433 EXPECT_TRUE(T.isArch32Bit()); in TEST()
434 EXPECT_FALSE(T.isArch64Bit()); in TEST()
436 T.setArch(Triple::mips64); in TEST()
437 EXPECT_FALSE(T.isArch16Bit()); in TEST()
438 EXPECT_FALSE(T.isArch32Bit()); in TEST()
439 EXPECT_TRUE(T.isArch64Bit()); in TEST()
441 T.setArch(Triple::msp430); in TEST()
442 EXPECT_TRUE(T.isArch16Bit()); in TEST()
443 EXPECT_FALSE(T.isArch32Bit()); in TEST()
444 EXPECT_FALSE(T.isArch64Bit()); in TEST()
446 T.setArch(Triple::ppc); in TEST()
447 EXPECT_FALSE(T.isArch16Bit()); in TEST()
448 EXPECT_TRUE(T.isArch32Bit()); in TEST()
449 EXPECT_FALSE(T.isArch64Bit()); in TEST()
451 T.setArch(Triple::ppc64); in TEST()
452 EXPECT_FALSE(T.isArch16Bit()); in TEST()
453 EXPECT_FALSE(T.isArch32Bit()); in TEST()
454 EXPECT_TRUE(T.isArch64Bit()); in TEST()
456 T.setArch(Triple::x86); in TEST()
457 EXPECT_FALSE(T.isArch16Bit()); in TEST()
458 EXPECT_TRUE(T.isArch32Bit()); in TEST()
459 EXPECT_FALSE(T.isArch64Bit()); in TEST()
461 T.setArch(Triple::x86_64); in TEST()
462 EXPECT_FALSE(T.isArch16Bit()); in TEST()
463 EXPECT_FALSE(T.isArch32Bit()); in TEST()
464 EXPECT_TRUE(T.isArch64Bit()); in TEST()
466 T.setArch(Triple::amdil); in TEST()
467 EXPECT_FALSE(T.isArch16Bit()); in TEST()
468 EXPECT_TRUE(T.isArch32Bit()); in TEST()
469 EXPECT_FALSE(T.isArch64Bit()); in TEST()
471 T.setArch(Triple::amdil64); in TEST()
472 EXPECT_FALSE(T.isArch16Bit()); in TEST()
473 EXPECT_FALSE(T.isArch32Bit()); in TEST()
474 EXPECT_TRUE(T.isArch64Bit()); in TEST()
476 T.setArch(Triple::hsail); in TEST()
477 EXPECT_FALSE(T.isArch16Bit()); in TEST()
478 EXPECT_TRUE(T.isArch32Bit()); in TEST()
479 EXPECT_FALSE(T.isArch64Bit()); in TEST()
481 T.setArch(Triple::hsail64); in TEST()
482 EXPECT_FALSE(T.isArch16Bit()); in TEST()
483 EXPECT_FALSE(T.isArch32Bit()); in TEST()
484 EXPECT_TRUE(T.isArch64Bit()); in TEST()
486 T.setArch(Triple::spir); in TEST()
487 EXPECT_FALSE(T.isArch16Bit()); in TEST()
488 EXPECT_TRUE(T.isArch32Bit()); in TEST()
489 EXPECT_FALSE(T.isArch64Bit()); in TEST()
491 T.setArch(Triple::spir64); in TEST()
492 EXPECT_FALSE(T.isArch16Bit()); in TEST()
493 EXPECT_FALSE(T.isArch32Bit()); in TEST()
494 EXPECT_TRUE(T.isArch64Bit()); in TEST()
496 T.setArch(Triple::sparc); in TEST()
497 EXPECT_FALSE(T.isArch16Bit()); in TEST()
498 EXPECT_TRUE(T.isArch32Bit()); in TEST()
499 EXPECT_FALSE(T.isArch64Bit()); in TEST()
501 T.setArch(Triple::sparcel); in TEST()
502 EXPECT_FALSE(T.isArch16Bit()); in TEST()
503 EXPECT_TRUE(T.isArch32Bit()); in TEST()
504 EXPECT_FALSE(T.isArch64Bit()); in TEST()
506 T.setArch(Triple::sparcv9); in TEST()
507 EXPECT_FALSE(T.isArch16Bit()); in TEST()
508 EXPECT_FALSE(T.isArch32Bit()); in TEST()
509 EXPECT_TRUE(T.isArch64Bit()); in TEST()
511 T.setArch(Triple::wasm32); in TEST()
512 EXPECT_FALSE(T.isArch16Bit()); in TEST()
513 EXPECT_TRUE(T.isArch32Bit()); in TEST()
514 EXPECT_FALSE(T.isArch64Bit()); in TEST()
516 T.setArch(Triple::wasm64); in TEST()
517 EXPECT_FALSE(T.isArch16Bit()); in TEST()
518 EXPECT_FALSE(T.isArch32Bit()); in TEST()
519 EXPECT_TRUE(T.isArch64Bit()); in TEST()
521 T.setArch(Triple::avr); in TEST()
522 EXPECT_TRUE(T.isArch16Bit()); in TEST()
523 EXPECT_FALSE(T.isArch32Bit()); in TEST()
524 EXPECT_FALSE(T.isArch64Bit()); in TEST()
526 T.setArch(Triple::lanai); in TEST()
527 EXPECT_FALSE(T.isArch16Bit()); in TEST()
528 EXPECT_TRUE(T.isArch32Bit()); in TEST()
529 EXPECT_FALSE(T.isArch64Bit()); in TEST()
533 Triple T; in TEST() local
534 EXPECT_EQ(Triple::UnknownArch, T.get32BitArchVariant().getArch()); in TEST()
535 EXPECT_EQ(Triple::UnknownArch, T.get64BitArchVariant().getArch()); in TEST()
537 T.setArch(Triple::UnknownArch); in TEST()
538 EXPECT_EQ(Triple::UnknownArch, T.get32BitArchVariant().getArch()); in TEST()
539 EXPECT_EQ(Triple::UnknownArch, T.get64BitArchVariant().getArch()); in TEST()
541 T.setArch(Triple::mips); in TEST()
542 EXPECT_EQ(Triple::mips, T.get32BitArchVariant().getArch()); in TEST()
543 EXPECT_EQ(Triple::mips64, T.get64BitArchVariant().getArch()); in TEST()
545 T.setArch(Triple::mipsel); in TEST()
546 EXPECT_EQ(Triple::mipsel, T.get32BitArchVariant().getArch()); in TEST()
547 EXPECT_EQ(Triple::mips64el, T.get64BitArchVariant().getArch()); in TEST()
549 T.setArch(Triple::ppc); in TEST()
550 EXPECT_EQ(Triple::ppc, T.get32BitArchVariant().getArch()); in TEST()
551 EXPECT_EQ(Triple::ppc64, T.get64BitArchVariant().getArch()); in TEST()
553 T.setArch(Triple::nvptx); in TEST()
554 EXPECT_EQ(Triple::nvptx, T.get32BitArchVariant().getArch()); in TEST()
555 EXPECT_EQ(Triple::nvptx64, T.get64BitArchVariant().getArch()); in TEST()
557 T.setArch(Triple::sparc); in TEST()
558 EXPECT_EQ(Triple::sparc, T.get32BitArchVariant().getArch()); in TEST()
559 EXPECT_EQ(Triple::sparcv9, T.get64BitArchVariant().getArch()); in TEST()
561 T.setArch(Triple::x86); in TEST()
562 EXPECT_EQ(Triple::x86, T.get32BitArchVariant().getArch()); in TEST()
563 EXPECT_EQ(Triple::x86_64, T.get64BitArchVariant().getArch()); in TEST()
565 T.setArch(Triple::mips64); in TEST()
566 EXPECT_EQ(Triple::mips, T.get32BitArchVariant().getArch()); in TEST()
567 EXPECT_EQ(Triple::mips64, T.get64BitArchVariant().getArch()); in TEST()
569 T.setArch(Triple::mips64el); in TEST()
570 EXPECT_EQ(Triple::mipsel, T.get32BitArchVariant().getArch()); in TEST()
571 EXPECT_EQ(Triple::mips64el, T.get64BitArchVariant().getArch()); in TEST()
573 T.setArch(Triple::ppc64); in TEST()
574 EXPECT_EQ(Triple::ppc, T.get32BitArchVariant().getArch()); in TEST()
575 EXPECT_EQ(Triple::ppc64, T.get64BitArchVariant().getArch()); in TEST()
577 T.setArch(Triple::nvptx64); in TEST()
578 EXPECT_EQ(Triple::nvptx, T.get32BitArchVariant().getArch()); in TEST()
579 EXPECT_EQ(Triple::nvptx64, T.get64BitArchVariant().getArch()); in TEST()
581 T.setArch(Triple::sparcv9); in TEST()
582 EXPECT_EQ(Triple::sparc, T.get32BitArchVariant().getArch()); in TEST()
583 EXPECT_EQ(Triple::sparcv9, T.get64BitArchVariant().getArch()); in TEST()
585 T.setArch(Triple::x86_64); in TEST()
586 EXPECT_EQ(Triple::x86, T.get32BitArchVariant().getArch()); in TEST()
587 EXPECT_EQ(Triple::x86_64, T.get64BitArchVariant().getArch()); in TEST()
589 T.setArch(Triple::amdil); in TEST()
590 EXPECT_EQ(Triple::amdil, T.get32BitArchVariant().getArch()); in TEST()
591 EXPECT_EQ(Triple::amdil64, T.get64BitArchVariant().getArch()); in TEST()
593 T.setArch(Triple::amdil64); in TEST()
594 EXPECT_EQ(Triple::amdil, T.get32BitArchVariant().getArch()); in TEST()
595 EXPECT_EQ(Triple::amdil64, T.get64BitArchVariant().getArch()); in TEST()
597 T.setArch(Triple::hsail); in TEST()
598 EXPECT_EQ(Triple::hsail, T.get32BitArchVariant().getArch()); in TEST()
599 EXPECT_EQ(Triple::hsail64, T.get64BitArchVariant().getArch()); in TEST()
601 T.setArch(Triple::hsail64); in TEST()
602 EXPECT_EQ(Triple::hsail, T.get32BitArchVariant().getArch()); in TEST()
603 EXPECT_EQ(Triple::hsail64, T.get64BitArchVariant().getArch()); in TEST()
605 T.setArch(Triple::spir); in TEST()
606 EXPECT_EQ(Triple::spir, T.get32BitArchVariant().getArch()); in TEST()
607 EXPECT_EQ(Triple::spir64, T.get64BitArchVariant().getArch()); in TEST()
609 T.setArch(Triple::spir64); in TEST()
610 EXPECT_EQ(Triple::spir, T.get32BitArchVariant().getArch()); in TEST()
611 EXPECT_EQ(Triple::spir64, T.get64BitArchVariant().getArch()); in TEST()
613 T.setArch(Triple::wasm32); in TEST()
614 EXPECT_EQ(Triple::wasm32, T.get32BitArchVariant().getArch()); in TEST()
615 EXPECT_EQ(Triple::wasm64, T.get64BitArchVariant().getArch()); in TEST()
617 T.setArch(Triple::wasm64); in TEST()
618 EXPECT_EQ(Triple::wasm32, T.get32BitArchVariant().getArch()); in TEST()
619 EXPECT_EQ(Triple::wasm64, T.get64BitArchVariant().getArch()); in TEST()
623 Triple T; in TEST() local
624 EXPECT_EQ(Triple::UnknownArch, T.getBigEndianArchVariant().getArch()); in TEST()
625 EXPECT_EQ(Triple::UnknownArch, T.getLittleEndianArchVariant().getArch()); in TEST()
627 T.setArch(Triple::UnknownArch); in TEST()
628 EXPECT_EQ(Triple::UnknownArch, T.getBigEndianArchVariant().getArch()); in TEST()
629 EXPECT_EQ(Triple::UnknownArch, T.getLittleEndianArchVariant().getArch()); in TEST()
631 T.setArch(Triple::aarch64_be); in TEST()
632 EXPECT_EQ(Triple::aarch64_be, T.getBigEndianArchVariant().getArch()); in TEST()
633 EXPECT_EQ(Triple::aarch64, T.getLittleEndianArchVariant().getArch()); in TEST()
635 T.setArch(Triple::aarch64); in TEST()
636 EXPECT_EQ(Triple::aarch64_be, T.getBigEndianArchVariant().getArch()); in TEST()
637 EXPECT_EQ(Triple::aarch64, T.getLittleEndianArchVariant().getArch()); in TEST()
639 T.setArch(Triple::armeb); in TEST()
640 EXPECT_EQ(Triple::armeb, T.getBigEndianArchVariant().getArch()); in TEST()
641 EXPECT_EQ(Triple::UnknownArch, T.getLittleEndianArchVariant().getArch()); in TEST()
643 T.setArch(Triple::arm); in TEST()
644 EXPECT_EQ(Triple::UnknownArch, T.getBigEndianArchVariant().getArch()); in TEST()
645 EXPECT_EQ(Triple::arm, T.getLittleEndianArchVariant().getArch()); in TEST()
646 T = Triple("arm"); in TEST()
647 EXPECT_TRUE(T.isLittleEndian()); in TEST()
648 T = Triple("thumb"); in TEST()
649 EXPECT_TRUE(T.isLittleEndian()); in TEST()
650 T = Triple("armeb"); in TEST()
651 EXPECT_FALSE(T.isLittleEndian()); in TEST()
652 T = Triple("thumbeb"); in TEST()
653 EXPECT_FALSE(T.isLittleEndian()); in TEST()
655 T.setArch(Triple::bpfeb); in TEST()
656 EXPECT_EQ(Triple::bpfeb, T.getBigEndianArchVariant().getArch()); in TEST()
657 EXPECT_EQ(Triple::bpfel, T.getLittleEndianArchVariant().getArch()); in TEST()
659 T.setArch(Triple::bpfel); in TEST()
660 EXPECT_EQ(Triple::bpfeb, T.getBigEndianArchVariant().getArch()); in TEST()
661 EXPECT_EQ(Triple::bpfel, T.getLittleEndianArchVariant().getArch()); in TEST()
663 T.setArch(Triple::mips64); in TEST()
664 EXPECT_EQ(Triple::mips64, T.getBigEndianArchVariant().getArch()); in TEST()
665 EXPECT_EQ(Triple::mips64el, T.getLittleEndianArchVariant().getArch()); in TEST()
667 T.setArch(Triple::mips64el); in TEST()
668 EXPECT_EQ(Triple::mips64, T.getBigEndianArchVariant().getArch()); in TEST()
669 EXPECT_EQ(Triple::mips64el, T.getLittleEndianArchVariant().getArch()); in TEST()
671 T.setArch(Triple::mips); in TEST()
672 EXPECT_EQ(Triple::mips, T.getBigEndianArchVariant().getArch()); in TEST()
673 EXPECT_EQ(Triple::mipsel, T.getLittleEndianArchVariant().getArch()); in TEST()
675 T.setArch(Triple::mipsel); in TEST()
676 EXPECT_EQ(Triple::mips, T.getBigEndianArchVariant().getArch()); in TEST()
677 EXPECT_EQ(Triple::mipsel, T.getLittleEndianArchVariant().getArch()); in TEST()
679 T.setArch(Triple::ppc); in TEST()
680 EXPECT_EQ(Triple::ppc, T.getBigEndianArchVariant().getArch()); in TEST()
681 EXPECT_EQ(Triple::UnknownArch, T.getLittleEndianArchVariant().getArch()); in TEST()
683 T.setArch(Triple::ppc64); in TEST()
684 EXPECT_EQ(Triple::ppc64, T.getBigEndianArchVariant().getArch()); in TEST()
685 EXPECT_EQ(Triple::ppc64le, T.getLittleEndianArchVariant().getArch()); in TEST()
687 T.setArch(Triple::ppc64le); in TEST()
688 EXPECT_EQ(Triple::ppc64, T.getBigEndianArchVariant().getArch()); in TEST()
689 EXPECT_EQ(Triple::ppc64le, T.getLittleEndianArchVariant().getArch()); in TEST()
691 T.setArch(Triple::sparc); in TEST()
692 EXPECT_EQ(Triple::sparc, T.getBigEndianArchVariant().getArch()); in TEST()
693 EXPECT_EQ(Triple::sparcel, T.getLittleEndianArchVariant().getArch()); in TEST()
695 T.setArch(Triple::sparcel); in TEST()
696 EXPECT_EQ(Triple::sparc, T.getBigEndianArchVariant().getArch()); in TEST()
697 EXPECT_EQ(Triple::sparcel, T.getLittleEndianArchVariant().getArch()); in TEST()
699 T.setArch(Triple::thumb); in TEST()
700 EXPECT_EQ(Triple::UnknownArch, T.getBigEndianArchVariant().getArch()); in TEST()
701 EXPECT_EQ(Triple::thumb, T.getLittleEndianArchVariant().getArch()); in TEST()
703 T.setArch(Triple::thumbeb); in TEST()
704 EXPECT_EQ(Triple::thumbeb, T.getBigEndianArchVariant().getArch()); in TEST()
705 EXPECT_EQ(Triple::UnknownArch, T.getLittleEndianArchVariant().getArch()); in TEST()
707 T.setArch(Triple::lanai); in TEST()
708 EXPECT_EQ(Triple::lanai, T.getBigEndianArchVariant().getArch()); in TEST()
709 EXPECT_EQ(Triple::UnknownArch, T.getLittleEndianArchVariant().getArch()); in TEST()
713 Triple T; in TEST() local
716 T = Triple("i386-apple-darwin9"); in TEST()
717 EXPECT_TRUE(T.isMacOSX()); in TEST()
718 EXPECT_FALSE(T.isiOS()); in TEST()
719 EXPECT_FALSE(T.isArch16Bit()); in TEST()
720 EXPECT_TRUE(T.isArch32Bit()); in TEST()
721 EXPECT_FALSE(T.isArch64Bit()); in TEST()
722 T.getMacOSXVersion(Major, Minor, Micro); in TEST()
726 T.getiOSVersion(Major, Minor, Micro); in TEST()
731 T = Triple("x86_64-apple-darwin9"); in TEST()
732 EXPECT_TRUE(T.isMacOSX()); in TEST()
733 EXPECT_FALSE(T.isiOS()); in TEST()
734 EXPECT_FALSE(T.isArch16Bit()); in TEST()
735 EXPECT_FALSE(T.isArch32Bit()); in TEST()
736 EXPECT_TRUE(T.isArch64Bit()); in TEST()
737 T.getMacOSXVersion(Major, Minor, Micro); in TEST()
741 T.getiOSVersion(Major, Minor, Micro); in TEST()
746 T = Triple("x86_64-apple-macosx"); in TEST()
747 EXPECT_TRUE(T.isMacOSX()); in TEST()
748 EXPECT_FALSE(T.isiOS()); in TEST()
749 EXPECT_FALSE(T.isArch16Bit()); in TEST()
750 EXPECT_FALSE(T.isArch32Bit()); in TEST()
751 EXPECT_TRUE(T.isArch64Bit()); in TEST()
752 T.getMacOSXVersion(Major, Minor, Micro); in TEST()
756 T.getiOSVersion(Major, Minor, Micro); in TEST()
761 T = Triple("x86_64-apple-macosx10.7"); in TEST()
762 EXPECT_TRUE(T.isMacOSX()); in TEST()
763 EXPECT_FALSE(T.isiOS()); in TEST()
764 EXPECT_FALSE(T.isArch16Bit()); in TEST()
765 EXPECT_FALSE(T.isArch32Bit()); in TEST()
766 EXPECT_TRUE(T.isArch64Bit()); in TEST()
767 T.getMacOSXVersion(Major, Minor, Micro); in TEST()
771 T.getiOSVersion(Major, Minor, Micro); in TEST()
776 T = Triple("armv7-apple-ios"); in TEST()
777 EXPECT_FALSE(T.isMacOSX()); in TEST()
778 EXPECT_TRUE(T.isiOS()); in TEST()
779 EXPECT_FALSE(T.isArch16Bit()); in TEST()
780 EXPECT_TRUE(T.isArch32Bit()); in TEST()
781 EXPECT_FALSE(T.isArch64Bit()); in TEST()
782 T.getMacOSXVersion(Major, Minor, Micro); in TEST()
786 T.getiOSVersion(Major, Minor, Micro); in TEST()
791 T = Triple("armv7-apple-ios7.0"); in TEST()
792 EXPECT_FALSE(T.isMacOSX()); in TEST()
793 EXPECT_TRUE(T.isiOS()); in TEST()
794 EXPECT_FALSE(T.isArch16Bit()); in TEST()
795 EXPECT_TRUE(T.isArch32Bit()); in TEST()
796 EXPECT_FALSE(T.isArch64Bit()); in TEST()
797 T.getMacOSXVersion(Major, Minor, Micro); in TEST()
801 T.getiOSVersion(Major, Minor, Micro); in TEST()
808 EXPECT_EQ(Triple::ELF, Triple("i686-unknown-linux-gnu").getObjectFormat()); in TEST()
809 EXPECT_EQ(Triple::ELF, Triple("i686-unknown-freebsd").getObjectFormat()); in TEST()
810 EXPECT_EQ(Triple::ELF, Triple("i686-unknown-netbsd").getObjectFormat()); in TEST()
811 EXPECT_EQ(Triple::ELF, Triple("i686--win32-elf").getObjectFormat()); in TEST()
812 EXPECT_EQ(Triple::ELF, Triple("i686---elf").getObjectFormat()); in TEST()
814 EXPECT_EQ(Triple::MachO, Triple("i686-apple-macosx").getObjectFormat()); in TEST()
815 EXPECT_EQ(Triple::MachO, Triple("i686-apple-ios").getObjectFormat()); in TEST()
816 EXPECT_EQ(Triple::MachO, Triple("i686---macho").getObjectFormat()); in TEST()
818 EXPECT_EQ(Triple::COFF, Triple("i686--win32").getObjectFormat()); in TEST()
820 EXPECT_EQ(Triple::ELF, Triple("i686-pc-windows-msvc-elf").getObjectFormat()); in TEST()
821 EXPECT_EQ(Triple::ELF, Triple("i686-pc-cygwin-elf").getObjectFormat()); in TEST()
823 Triple MSVCNormalized(Triple::normalize("i686-pc-windows-msvc-elf")); in TEST()
826 Triple GNUWindowsNormalized(Triple::normalize("i686-pc-windows-gnu-elf")); in TEST()
829 Triple CygnusNormalised(Triple::normalize("i686-pc-windows-cygnus-elf")); in TEST()
832 Triple CygwinNormalized(Triple::normalize("i686-pc-cygwin-elf")); in TEST()
835 Triple T = Triple(""); in TEST() local
836 T.setObjectFormat(Triple::ELF); in TEST()
837 EXPECT_EQ(Triple::ELF, T.getObjectFormat()); in TEST()
841 EXPECT_EQ("i686-pc-windows-msvc", Triple::normalize("i686-pc-win32")); in TEST()
842 EXPECT_EQ("i686--windows-msvc", Triple::normalize("i686-win32")); in TEST()
843 EXPECT_EQ("i686-pc-windows-gnu", Triple::normalize("i686-pc-mingw32")); in TEST()
844 EXPECT_EQ("i686--windows-gnu", Triple::normalize("i686-mingw32")); in TEST()
845 EXPECT_EQ("i686-pc-windows-gnu", Triple::normalize("i686-pc-mingw32-w64")); in TEST()
846 EXPECT_EQ("i686--windows-gnu", Triple::normalize("i686-mingw32-w64")); in TEST()
847 EXPECT_EQ("i686-pc-windows-cygnus", Triple::normalize("i686-pc-cygwin")); in TEST()
848 EXPECT_EQ("i686--windows-cygnus", Triple::normalize("i686-cygwin")); in TEST()
850 EXPECT_EQ("x86_64-pc-windows-msvc", Triple::normalize("x86_64-pc-win32")); in TEST()
851 EXPECT_EQ("x86_64--windows-msvc", Triple::normalize("x86_64-win32")); in TEST()
852 EXPECT_EQ("x86_64-pc-windows-gnu", Triple::normalize("x86_64-pc-mingw32")); in TEST()
853 EXPECT_EQ("x86_64--windows-gnu", Triple::normalize("x86_64-mingw32")); in TEST()
854 EXPECT_EQ("x86_64-pc-windows-gnu", Triple::normalize("x86_64-pc-mingw32-w64")); in TEST()
855 EXPECT_EQ("x86_64--windows-gnu", Triple::normalize("x86_64-mingw32-w64")); in TEST()
857 EXPECT_EQ("i686-pc-windows-elf", Triple::normalize("i686-pc-win32-elf")); in TEST()
858 EXPECT_EQ("i686--windows-elf", Triple::normalize("i686-win32-elf")); in TEST()
859 EXPECT_EQ("i686-pc-windows-macho", Triple::normalize("i686-pc-win32-macho")); in TEST()
860 EXPECT_EQ("i686--windows-macho", Triple::normalize("i686-win32-macho")); in TEST()
862 EXPECT_EQ("x86_64-pc-windows-elf", Triple::normalize("x86_64-pc-win32-elf")); in TEST()
863 EXPECT_EQ("x86_64--windows-elf", Triple::normalize("x86_64-win32-elf")); in TEST()
864 EXPECT_EQ("x86_64-pc-windows-macho", Triple::normalize("x86_64-pc-win32-macho")); in TEST()
865 EXPECT_EQ("x86_64--windows-macho", Triple::normalize("x86_64-win32-macho")); in TEST()
867 EXPECT_EQ("i686-pc-windows-cygnus", in TEST()
868 Triple::normalize("i686-pc-windows-cygnus")); in TEST()
869 EXPECT_EQ("i686-pc-windows-gnu", Triple::normalize("i686-pc-windows-gnu")); in TEST()
870 EXPECT_EQ("i686-pc-windows-itanium", Triple::normalize("i686-pc-windows-itanium")); in TEST()
871 EXPECT_EQ("i686-pc-windows-msvc", Triple::normalize("i686-pc-windows-msvc")); in TEST()
873 EXPECT_EQ("i686-pc-windows-elf", Triple::normalize("i686-pc-windows-elf-elf")); in TEST()
879 llvm::Triple Triple("armv4-unknown-eabi"); in TEST()
883 llvm::Triple Triple("armv4t-unknown-eabi"); in TEST()
887 llvm::Triple Triple("armv5-unknown-eabi"); in TEST()
891 llvm::Triple Triple("armv5t-unknown-eabi"); in TEST()
895 llvm::Triple Triple("armv5e-unknown-eabi"); in TEST()
899 llvm::Triple Triple("armv5tej-unknown-eabi"); in TEST()
900 EXPECT_EQ("arm926ej-s", Triple.getARMCPUForArch()); in TEST()
903 llvm::Triple Triple("armv6-unknown-eabi"); in TEST()
904 EXPECT_EQ("arm1136jf-s", Triple.getARMCPUForArch()); in TEST()
907 llvm::Triple Triple("armv6j-unknown-eabi"); in TEST()
908 EXPECT_EQ("arm1136jf-s", Triple.getARMCPUForArch()); in TEST()
911 llvm::Triple Triple("armv6k-unknown-eabi"); in TEST()
912 EXPECT_EQ("arm1176j-s", Triple.getARMCPUForArch()); in TEST()
915 llvm::Triple Triple("armv6kz-unknown-eabi"); in TEST()
916 EXPECT_EQ("arm1176jzf-s", Triple.getARMCPUForArch()); in TEST()
919 llvm::Triple Triple("armv6zk-unknown-eabi"); in TEST()
920 EXPECT_EQ("arm1176jzf-s", Triple.getARMCPUForArch()); in TEST()
923 llvm::Triple Triple("armv6t2-unknown-eabi"); in TEST()
924 EXPECT_EQ("arm1156t2-s", Triple.getARMCPUForArch()); in TEST()
927 llvm::Triple Triple("armv6m-unknown-eabi"); in TEST()
928 EXPECT_EQ("cortex-m0", Triple.getARMCPUForArch()); in TEST()
931 llvm::Triple Triple("armv7-unknown-eabi"); in TEST()
932 EXPECT_EQ("cortex-a8", Triple.getARMCPUForArch()); in TEST()
935 llvm::Triple Triple("armv7a-unknown-eabi"); in TEST()
936 EXPECT_EQ("cortex-a8", Triple.getARMCPUForArch()); in TEST()
939 llvm::Triple Triple("armv7m-unknown-eabi"); in TEST()
940 EXPECT_EQ("cortex-m3", Triple.getARMCPUForArch()); in TEST()
943 llvm::Triple Triple("armv7r-unknown-eabi"); in TEST()
944 EXPECT_EQ("cortex-r4", Triple.getARMCPUForArch()); in TEST()
947 llvm::Triple Triple("armv7r-unknown-eabi"); in TEST()
948 EXPECT_EQ("cortex-r4", Triple.getARMCPUForArch()); in TEST()
951 llvm::Triple Triple("armv7r-unknown-eabi"); in TEST()
952 EXPECT_EQ("cortex-r4", Triple.getARMCPUForArch()); in TEST()
955 llvm::Triple Triple("armv7r-unknown-eabi"); in TEST()
956 EXPECT_EQ("cortex-r4", Triple.getARMCPUForArch()); in TEST()
959 llvm::Triple Triple("armv8a-unknown-eabi"); in TEST()
960 EXPECT_EQ("cortex-a53", Triple.getARMCPUForArch()); in TEST()
963 llvm::Triple Triple("armv8.1a-unknown-eabi"); in TEST()
966 // Non-synonym names, using -march style, not default arch. in TEST()
969 EXPECT_EQ("cortex-a8", Triple.getARMCPUForArch("armv7-a")); in TEST()
973 EXPECT_EQ("cortex-m3", Triple.getARMCPUForArch("armv7-m")); in TEST()
977 EXPECT_EQ("cortex-a53", Triple.getARMCPUForArch("armv8")); in TEST()
981 EXPECT_EQ("cortex-a53", Triple.getARMCPUForArch("armv8-a")); in TEST()
985 llvm::Triple Triple("arm--nacl"); in TEST()
986 EXPECT_EQ("cortex-a8", Triple.getARMCPUForArch()); in TEST()
989 llvm::Triple Triple("armv6-unknown-freebsd"); in TEST()
990 EXPECT_EQ("arm1176jzf-s", Triple.getARMCPUForArch()); in TEST()
993 llvm::Triple Triple("thumbv6-unknown-freebsd"); in TEST()
994 EXPECT_EQ("arm1176jzf-s", Triple.getARMCPUForArch()); in TEST()
997 llvm::Triple Triple("armebv6-unknown-freebsd"); in TEST()
998 EXPECT_EQ("arm1176jzf-s", Triple.getARMCPUForArch()); in TEST()
1001 llvm::Triple Triple("arm--win32"); in TEST()
1002 EXPECT_EQ("cortex-a9", Triple.getARMCPUForArch()); in TEST()
1006 llvm::Triple Triple("xscale-unknown-eabi"); in TEST()
1010 llvm::Triple Triple("iwmmxt-unknown-eabi"); in TEST()
1014 llvm::Triple Triple("armv7s-apple-ios7"); in TEST()
1018 llvm::Triple Triple("armv7k-apple-ios9"); in TEST()
1019 EXPECT_EQ("cortex-a7", Triple.getARMCPUForArch()); in TEST()
1022 llvm::Triple Triple("armv7k-apple-watchos3"); in TEST()
1023 EXPECT_EQ("cortex-a7", Triple.getARMCPUForArch()); in TEST()
1026 llvm::Triple Triple("armv7k-apple-tvos9"); in TEST()
1027 EXPECT_EQ("cortex-a7", Triple.getARMCPUForArch()); in TEST()
1030 llvm::Triple Triple("armv7em-apple-ios7"); in TEST()
1031 EXPECT_EQ("cortex-m4", Triple.getARMCPUForArch()); in TEST()
1034 llvm::Triple Triple("armv7l-linux-gnueabihf"); in TEST()
1035 EXPECT_EQ("cortex-a8", Triple.getARMCPUForArch()); in TEST()
1038 llvm::Triple Triple("armv6sm-apple-ios7"); in TEST()
1039 EXPECT_EQ("cortex-m0", Triple.getARMCPUForArch()); in TEST()
1043 llvm::Triple Triple("armeb-none-eabi"); in TEST()
1047 llvm::Triple Triple("armebeb-none-eabi"); in TEST()
1051 llvm::Triple Triple("armebv6eb-none-eabi"); in TEST()
1056 llvm::Triple Triple("armebv6-non-eabi"); in TEST()
1057 EXPECT_EQ("arm1136jf-s", Triple.getARMCPUForArch()); in TEST()
1060 llvm::Triple Triple("armv6eb-none-eabi"); in TEST()
1061 EXPECT_EQ("arm1136jf-s", Triple.getARMCPUForArch()); in TEST()
1065 llvm::Triple Triple("xscaleeb-none-eabi"); in TEST()
1069 llvm::Triple Triple("armebxscale-none-eabi"); in TEST()
1075 EXPECT_EQ("armv6--netbsd-eabi", Triple::normalize("armv6-netbsd-eabi")); in TEST()
1076 EXPECT_EQ("armv7--netbsd-eabi", Triple::normalize("armv7-netbsd-eabi")); in TEST()
1077 EXPECT_EQ("armv6eb--netbsd-eabi", Triple::normalize("armv6eb-netbsd-eabi")); in TEST()
1078 EXPECT_EQ("armv7eb--netbsd-eabi", Triple::normalize("armv7eb-netbsd-eabi")); in TEST()
1079 EXPECT_EQ("armv6--netbsd-eabihf", Triple::normalize("armv6-netbsd-eabihf")); in TEST()
1080 EXPECT_EQ("armv7--netbsd-eabihf", Triple::normalize("armv7-netbsd-eabihf")); in TEST()
1081 EXPECT_EQ("armv6eb--netbsd-eabihf", Triple::normalize("armv6eb-netbsd-eabihf")); in TEST()
1082 EXPECT_EQ("armv7eb--netbsd-eabihf", Triple::normalize("armv7eb-netbsd-eabihf")); in TEST()
1084 Triple T; in TEST() local
1085 T = Triple("armv6--netbsd-eabi"); in TEST()
1086 EXPECT_EQ(Triple::arm, T.getArch()); in TEST()
1087 T = Triple("armv6eb--netbsd-eabi"); in TEST()
1088 EXPECT_EQ(Triple::armeb, T.getArch()); in TEST()
1094 Triple T = Triple("arm"); in TEST() local
1095 EXPECT_EQ(Triple::arm, T.getArch()); in TEST()
1098 Triple T = Triple("armv6t2"); in TEST() local
1099 EXPECT_EQ(Triple::arm, T.getArch()); in TEST()
1102 Triple T = Triple("armv8"); in TEST() local
1103 EXPECT_EQ(Triple::arm, T.getArch()); in TEST()
1106 Triple T = Triple("armeb"); in TEST() local
1107 EXPECT_EQ(Triple::armeb, T.getArch()); in TEST()
1110 Triple T = Triple("armv5eb"); in TEST() local
1111 EXPECT_EQ(Triple::armeb, T.getArch()); in TEST()
1114 Triple T = Triple("armebv7m"); in TEST() local
1115 EXPECT_EQ(Triple::armeb, T.getArch()); in TEST()
1118 Triple T = Triple("armv7eb"); in TEST() local
1119 EXPECT_EQ(Triple::armeb, T.getArch()); in TEST()
1123 Triple T = Triple("thumb"); in TEST() local
1124 EXPECT_EQ(Triple::thumb, T.getArch()); in TEST()
1127 Triple T = Triple("thumbv7a"); in TEST() local
1128 EXPECT_EQ(Triple::thumb, T.getArch()); in TEST()
1131 Triple T = Triple("thumbeb"); in TEST() local
1132 EXPECT_EQ(Triple::thumbeb, T.getArch()); in TEST()
1135 Triple T = Triple("thumbv4teb"); in TEST() local
1136 EXPECT_EQ(Triple::thumbeb, T.getArch()); in TEST()
1139 Triple T = Triple("thumbebv7"); in TEST() local
1140 EXPECT_EQ(Triple::thumbeb, T.getArch()); in TEST()
1143 Triple T = Triple("armv6m"); in TEST() local
1144 EXPECT_EQ(Triple::thumb, T.getArch()); in TEST()
1147 Triple T = Triple("thumbv2"); in TEST() local
1148 EXPECT_EQ(Triple::UnknownArch, T.getArch()); in TEST()
1151 Triple T = Triple("thumbebv6eb"); in TEST() local
1152 EXPECT_EQ(Triple::UnknownArch, T.getArch()); in TEST()
1156 Triple T = Triple("arm64"); in TEST() local
1157 EXPECT_EQ(Triple::aarch64, T.getArch()); in TEST()
1160 Triple T = Triple("aarch64"); in TEST() local
1161 EXPECT_EQ(Triple::aarch64, T.getArch()); in TEST()
1164 Triple T = Triple("aarch64_be"); in TEST() local
1165 EXPECT_EQ(Triple::aarch64_be, T.getArch()); in TEST()
1168 Triple T = Triple("aarch64be"); in TEST() local
1169 EXPECT_EQ(Triple::UnknownArch, T.getArch()); in TEST()
1172 Triple T = Triple("arm64be"); in TEST() local
1173 EXPECT_EQ(Triple::UnknownArch, T.getArch()); in TEST()