r252640 - Add the variant of __sparc_v9__ with five underscores, not just four.

Joerg Sonnenberger via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 11:28:18 PST 2015


Author: joerg
Date: Tue Nov 10 13:28:17 2015
New Revision: 252640

URL: http://llvm.org/viewvc/llvm-project?rev=252640&view=rev
Log:
Add the variant of __sparc_v9__ with five underscores, not just four.

Modified:
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/test/Preprocessor/predefined-arch-macros.c

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=252640&r1=252639&r2=252640&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Nov 10 13:28:17 2015
@@ -5949,8 +5949,10 @@ public:
       break;
     case CG_V9:
       Builder.defineMacro("__sparcv9");
-      if (getTriple().getOS() != llvm::Triple::Solaris)
+      if (getTriple().getOS() != llvm::Triple::Solaris) {
         Builder.defineMacro("__sparcv9__");
+        Builder.defineMacro("__sparc_v9__");
+      }
       break;
     }
   }

Modified: cfe/trunk/test/Preprocessor/predefined-arch-macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/predefined-arch-macros.c?rev=252640&r1=252639&r2=252640&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/predefined-arch-macros.c (original)
+++ cfe/trunk/test/Preprocessor/predefined-arch-macros.c Tue Nov 10 13:28:17 2015
@@ -1749,10 +1749,13 @@
 // CHECK_SPARC: #define __sparc 1
 // CHECK_SPARC: #define __sparc__ 1
 // CHECK_SPARC-NOT: #define __sparcv9 1
+// CHECK_SPARC-NOT: #define __sparcv9__ 1
 // CHECK_SPARC: #define __sparcv8 1
 // CHECK_SPARC-NOT: #define __sparcv9 1
+// CHECK_SPARC-NOT: #define __sparcv9__ 1
 
 // CHECK_SPARC-V9-NOT: #define __sparcv8 1
+// CHECK_SPARC-V9: #define __sparc_v9__ 1
 // CHECK_SPARC-V9: #define __sparcv9 1
 // CHECK_SPARC-V9-NOT: #define __sparcv8 1
 




More information about the cfe-commits mailing list