llvm.org GIT mirror llvm / aea1537
[Triple] Define OS Check for Haiku This adds the OS check for the Haiku operating system, as it was missing in the Triple class. Tests for x86_64-unknown-haiku and i586-pc-haiku were also added. These patches only affect Haiku and are completely harmless for other platforms. Patch by Calvin Hill <calvin@hakobaito.co.uk> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311153 91177308-0d34-0410-b5e6-96231b3b80d8 Renato Golin 2 years ago
2 changed file(s) with 17 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
503503 return getOS() == Triple::Contiki;
504504 }
505505
506 /// Tests whether the OS is Haiku.
507 bool isOSHaiku() const {
508 return getOS() == Triple::Haiku;
509 }
510
506511 /// Checks if the environment could be MSVC.
507512 bool isWindowsMSVCEnvironment() const {
508513 return getOS() == Triple::Win32 &&
294294 EXPECT_EQ(Triple::SUSE, T.getVendor());
295295 EXPECT_EQ(Triple::Linux, T.getOS());
296296 EXPECT_EQ(Triple::GNUEABI, T.getEnvironment());
297
298 T = Triple("i586-pc-haiku");
299 EXPECT_EQ(Triple::x86, T.getArch());
300 EXPECT_EQ(Triple::PC, T.getVendor());
301 EXPECT_EQ(Triple::Haiku, T.getOS());
302 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
303
304 T = Triple("x86_64-unknown-haiku");
305 EXPECT_EQ(Triple::x86_64, T.getArch());
306 EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
307 EXPECT_EQ(Triple::Haiku, T.getOS());
308 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
297309
298310 T = Triple("huh");
299311 EXPECT_EQ(Triple::UnknownArch, T.getArch());