summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/clang-translation.c
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2012-06-11 22:35:19 +0000
committerHal Finkel <hfinkel@anl.gov>2012-06-11 22:35:19 +0000
commit8eb592851461ff710241ec5e5209751cafb5385c (patch)
tree26a09f50377e3d62d6c13de8e42d1ea071d737ba /clang/test/Driver/clang-translation.c
parent8a87c12355856dd9034c5a017f5b5dd4794f91e8 (diff)
downloadbcm5719-llvm-8eb592851461ff710241ec5e5209751cafb5385c.tar.gz
bcm5719-llvm-8eb592851461ff710241ec5e5209751cafb5385c.zip
Add PPC support for translating gcc-style -mcpu options into LLVM -target-cpu options.
This functionality is based on what is done on ARM, and enables selecting PPC CPUs in a way compatible with gcc's driver. Also, mirroring gcc (and what is done on x86), -mcpu=native support was added. This uses the host cpu detection from LLVM (which will also soon be updated by refactoring code currently in backend). In order for this to work, the target needs a list of valid CPUs -- we now accept all CPUs accepted by LLVM. A few preprocessor defines for common CPU types have been added. llvm-svn: 158334
Diffstat (limited to 'clang/test/Driver/clang-translation.c')
-rw-r--r--clang/test/Driver/clang-translation.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/Driver/clang-translation.c b/clang/test/Driver/clang-translation.c
index 3ab6f5be485..cc368bb0cba 100644
--- a/clang/test/Driver/clang-translation.c
+++ b/clang/test/Driver/clang-translation.c
@@ -51,3 +51,23 @@
// ARMV5E: clang
// ARMV5E: "-cc1"
// ARMV5E: "-target-cpu" "arm1022e"
+
+// RUN: %clang -target powerpc64-unknown-linux-gnu -### -S %s 2> %t.log \
+// RUN: -mcpu=G5
+// RUN: FileCheck -check-prefix=PPCG5 %s < %t.log
+// PPCG5: clang
+// PPCG5: "-cc1"
+// PPCG5: "-target-cpu" "g5"
+
+// RUN: %clang -target powerpc64-unknown-linux-gnu -### -S %s 2> %t.log \
+// RUN: -mcpu=power7
+// RUN: FileCheck -check-prefix=PPCPWR7 %s < %t.log
+// PPCPWR7: clang
+// PPCPWR7: "-cc1"
+// PPCPWR7: "-target-cpu" "pwr7"
+
+// RUN: %clang -target powerpc64-unknown-linux-gnu -### -S %s 2> %t.log
+// RUN: FileCheck -check-prefix=PPC64NS %s < %t.log
+// PPC64NS: clang
+// PPC64NS: "-cc1"
+// PPC64NS: "-target-cpu" "ppc64"
OpenPOWER on IntegriCloud