From 8eb592851461ff710241ec5e5209751cafb5385c Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Mon, 11 Jun 2012 22:35:19 +0000 Subject: 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 --- clang/test/Driver/clang-translation.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'clang/test/Driver') 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" -- cgit v1.2.3