Index: lib/Basic/Targets/Sparc.cpp =================================================================== --- lib/Basic/Targets/Sparc.cpp +++ lib/Basic/Targets/Sparc.cpp @@ -178,6 +178,13 @@ Builder.defineMacro(MyriadArchValue, "1"); Builder.defineMacro(MyriadArchValue + "__", "1"); } + if (Myriad2Value == "2") { + Builder.defineMacro("__ma2x5x", "1"); + Builder.defineMacro("__ma2x5x__", "1"); + } else if (Myriad2Value == "3") { + Builder.defineMacro("__ma2x8x", "1"); + Builder.defineMacro("__ma2x8x__", "1"); + } Builder.defineMacro("__myriad2__", Myriad2Value); Builder.defineMacro("__myriad2", Myriad2Value); } Index: test/Preprocessor/predefined-arch-macros.c =================================================================== --- test/Preprocessor/predefined-arch-macros.c +++ test/Preprocessor/predefined-arch-macros.c @@ -2401,8 +2401,12 @@ // CHECK_MYRIAD2: #define __leon__ 1 // CHECK_MYRIAD2-1: #define __myriad2 1 // CHECK_MYRIAD2-1: #define __myriad2__ 1 +// CHECK_MYRIAD2-2: #define __ma2x5x 1 +// CHECK_MYRIAD2-2: #define __ma2x5x__ 1 // CHECK_MYRIAD2-2: #define __myriad2 2 // CHECK_MYRIAD2-2: #define __myriad2__ 2 +// CHECK_MYRIAD2-3: #define __ma2x8x 1 +// CHECK_MYRIAD2-3: #define __ma2x8x__ 1 // CHECK_MYRIAD2-3: #define __myriad2 3 // CHECK_MYRIAD2-3: #define __myriad2__ 3 // CHECK_SPARCEL: #define __sparc 1