llvm.org GIT mirror llvm / a47406c
Add triple support for the IBM BG/P and BG/Q supercomputers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153882 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 8 years ago
3 changed file(s) with 29 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
7171
7272 Apple,
7373 PC,
74 SCEI
74 SCEI,
75 BGP,
76 BGQ
7577 };
7678 enum OSType {
7779 UnknownOS,
9496 Haiku,
9597 Minix,
9698 RTEMS,
97 NativeClient
99 NativeClient,
100 CNK // BG/P Compute-Node Kernel
98101 };
99102 enum EnvironmentType {
100103 UnknownEnvironment,
8787 case Apple: return "apple";
8888 case PC: return "pc";
8989 case SCEI: return "scei";
90 case BGP: return "bgp";
91 case BGQ: return "bgq";
9092 }
9193
9294 llvm_unreachable("Invalid VendorType!");
115117 case Minix: return "minix";
116118 case RTEMS: return "rtems";
117119 case NativeClient: return "nacl";
120 case CNK: return "cnk";
118121 }
119122
120123 llvm_unreachable("Invalid OSType");
257260 .Case("apple", Triple::Apple)
258261 .Case("pc", Triple::PC)
259262 .Case("scei", Triple::SCEI)
263 .Case("bgp", Triple::BGP)
264 .Case("bgq", Triple::BGQ)
260265 .Default(Triple::UnknownVendor);
261266 }
262267
281286 .StartsWith("minix", Triple::Minix)
282287 .StartsWith("rtems", Triple::RTEMS)
283288 .StartsWith("nacl", Triple::NativeClient)
289 .StartsWith("cnk", Triple::CNK)
284290 .Default(Triple::UnknownOS);
285291 }
286292
8585 EXPECT_EQ(Triple::PC, T.getVendor());
8686 EXPECT_EQ(Triple::Linux, T.getOS());
8787 EXPECT_EQ(Triple::GNU, T.getEnvironment());
88
89 T = Triple("powerpc-bgp-linux");
90 EXPECT_EQ(Triple::ppc, T.getArch());
91 EXPECT_EQ(Triple::BGP, T.getVendor());
92 EXPECT_EQ(Triple::Linux, T.getOS());
93 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
94
95 T = Triple("powerpc-bgp-cnk");
96 EXPECT_EQ(Triple::ppc, T.getArch());
97 EXPECT_EQ(Triple::BGP, T.getVendor());
98 EXPECT_EQ(Triple::CNK, T.getOS());
99 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
100
101 T = Triple("powerpc64-bgq-linux");
102 EXPECT_EQ(Triple::ppc64, T.getArch());
103 EXPECT_EQ(Triple::BGQ, T.getVendor());
104 EXPECT_EQ(Triple::Linux, T.getOS());
105 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
88106
89107 T = Triple("powerpc-dunno-notsure");
90108 EXPECT_EQ(Triple::ppc, T.getArch());