llvm.org GIT mirror llvm / 2fe27c3
[ADT] Recognize ppc as valid architecture in target triple. Until this patch, only `powerpc` and `ppc32` were recognized as valid PowerPC 32-bit architectures in a target triple. This was incompatible with the triple `ppc-apple-darwin` as returned for libObject. I found out about this when working on a test case using a binary generated on an old PowerBook G4. We had the choice of either fix this in the Mach-O object parser or in the Triple implementation. I chose the latter because it feels like the most canonical place. Differential revision: https://reviews.llvm.org/D43760 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326182 91177308-0d34-0410-b5e6-96231b3b80d8 Jonas Devlieghere 2 years ago
2 changed file(s) with 18 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
383383 // FIXME: Do we need to support these?
384384 .Cases("i786", "i886", "i986", Triple::x86)
385385 .Cases("amd64", "x86_64", "x86_64h", Triple::x86_64)
386 .Cases("powerpc", "ppc32", Triple::ppc)
386 .Cases("powerpc", "ppc", "ppc32", Triple::ppc)
387387 .Cases("powerpc64", "ppu", "ppc64", Triple::ppc64)
388388 .Cases("powerpc64le", "ppc64le", Triple::ppc64le)
389389 .Case("xscale", Triple::arm)
116116 EXPECT_EQ(Triple::CNK, T.getOS());
117117 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
118118
119 T = Triple("ppc-bgp-linux");
120 EXPECT_EQ(Triple::ppc, T.getArch());
121 EXPECT_EQ(Triple::BGP, T.getVendor());
122 EXPECT_EQ(Triple::Linux, T.getOS());
123 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
124
125 T = Triple("ppc32-bgp-linux");
126 EXPECT_EQ(Triple::ppc, T.getArch());
127 EXPECT_EQ(Triple::BGP, T.getVendor());
128 EXPECT_EQ(Triple::Linux, T.getOS());
129 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
130
119131 T = Triple("powerpc64-bgq-linux");
120132 EXPECT_EQ(Triple::ppc64, T.getArch());
121133 EXPECT_EQ(Triple::BGQ, T.getVendor());
122134 EXPECT_EQ(Triple::Linux, T.getOS());
123135 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
136
137 T = Triple("ppc64-bgq-linux");
138 EXPECT_EQ(Triple::ppc64, T.getArch());
139 EXPECT_EQ(Triple::BGQ, T.getVendor());
140 EXPECT_EQ(Triple::Linux, T.getOS());
124141
125142 T = Triple("powerpc-ibm-aix");
126143 EXPECT_EQ(Triple::ppc, T.getArch());