[PATCH] D63497: Add support for openSUSE RISC-V triple

Andreas Schwab via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 18 09:06:03 PDT 2019


schwab created this revision.
Herald added subscribers: llvm-commits, cfe-commits, rkruppe, dexonsmith, rogfer01, shiva0217, kito-cheng.
Herald added projects: clang, LLVM.

Repository:
  rC Clang

https://reviews.llvm.org/D63497

Files:
  clang/lib/Driver/ToolChains/Gnu.cpp
  llvm/unittests/ADT/TripleTest.cpp


Index: llvm/unittests/ADT/TripleTest.cpp
===================================================================
--- llvm/unittests/ADT/TripleTest.cpp
+++ llvm/unittests/ADT/TripleTest.cpp
@@ -330,6 +330,12 @@
   EXPECT_EQ(Triple::FreeBSD, T.getOS());
   EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
 
+  T = Triple("riscv64-suse-linux");
+  EXPECT_EQ(Triple::riscv64, T.getArch());
+  EXPECT_EQ(Triple::SUSE, T.getVendor());
+  EXPECT_EQ(Triple::Linux, T.getOS());
+  EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+
   T = Triple("armv7hl-suse-linux-gnueabi");
   EXPECT_EQ(Triple::arm, T.getArch());
   EXPECT_EQ(Triple::SUSE, T.getVendor());
Index: clang/lib/Driver/ToolChains/Gnu.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2021,7 +2021,8 @@
   static const char *const RISCV64LibDirs[] = {"/lib64", "/lib"};
   static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu",
                                                "riscv64-linux-gnu",
-                                               "riscv64-unknown-elf"};
+                                               "riscv64-unknown-elf",
+                                               "riscv64-suse-linux"};
 
   static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"};
   static const char *const SPARCv8Triples[] = {"sparc-linux-gnu",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63497.205315.patch
Type: text/x-patch
Size: 1444 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190618/6921b7fe/attachment.bin>


More information about the cfe-commits mailing list