[cfe-commits] [PATCH 1/3] Add Freescale cpu names

Tobias von Koch tobias.von.koch at gmail.com
Fri Aug 31 06:31:01 PDT 2012


New patch with test case attached!

Thanks again,
Hal

On 28/08/2012 19:49, Hal Finkel wrote:
> Tobias,
>
> Please add a test case to:
> test/Driver/clang-translation.c (look near the bottom of the file).
>
>   -Hal
>
> On Tue, 28 Aug 2012 18:53:57 +0200
> Tobias von Koch <tobias.von.koch at gmail.com> wrote:
>
>> Dear all,
>>
>> This is part of a sequence of three (trivial) patches to allow Clang
>> to be used as a drop-in replacement for GCC with the Freescale SDK.
>> Support for Freescale processors has just been added to the PowerPC
>> backend.
>>
>> Please review and commit if this is OK - I don't have commit access.
>>
>> Thanks!
>> Tobias
>>
>> Description of patch:
>>
>> Add e500mc and e5500 to cpu names recognized by -mcpu=... for PPC.
>>
>
>
>

-------------- next part --------------
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -641,6 +641,8 @@ public:
       .Case("970", true)
       .Case("g5", true)
       .Case("a2", true)
+      .Case("e500mc", true)
+      .Case("e5500", true)
       .Case("pwr6", true)
       .Case("pwr7", true)
       .Case("ppc", true)
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -978,6 +978,8 @@ static std::string getPPCTargetCPU(const ArgList &Args) {
       .Case("970", "970")
       .Case("G5", "g5")
       .Case("a2", "a2")
+      .Case("e500mc", "e500mc")
+      .Case("e5500", "e5500")
       .Case("power6", "pwr6")
       .Case("power7", "pwr7")
       .Case("powerpc", "ppc")
--- a/test/Driver/clang-translation.c
+++ b/test/Driver/clang-translation.c
@@ -74,3 +74,20 @@
 // PPC64NS: clang
 // PPC64NS: "-cc1"
 // PPC64NS: "-target-cpu" "ppc64"
+
+// RUN: %clang -ccc-clang-archs powerpc \
+// RUN:   -target powerpc-fsl-linux -### -S %s 2> %t.log \
+// RUN:   -mcpu=e500mc
+// RUN: FileCheck -check-prefix=PPCE500MC %s < %t.log
+// PPCE500MC: clang
+// PPCE500MC: "-cc1"
+// PPCE500MC: "-target-cpu" "e500mc"
+
+// RUN: %clang -ccc-clang-archs powerpc64 \
+// RUN:   -target powerpc64-fsl-linux -### -S %s 2> %t.log \
+// RUN:   -mcpu=e5500
+// RUN: FileCheck -check-prefix=PPCE5500 %s < %t.log
+// PPCE5500: clang
+// PPCE5500: "-cc1"
+// PPCE5500: "-target-cpu" "e5500"
+


More information about the cfe-commits mailing list