Will Schmidt
2014-Jun-24 21:44 UTC
[LLVMdev] [5/5 PATCH/RFC PPC64] tests for power8 keyword
Assorted tests for the power8/pwr8 keyword. diff --git a/tools/clang/test/Driver/clang-translation.c b/tools/clang/test/Driver/clang-translation.c index 54e5bbe..a525b7f 100644 --- a/tools/clang/test/Driver/clang-translation.c +++ b/tools/clang/test/Driver/clang-translation.c @@ -71,6 +71,12 @@ // PPCPWR7: "-target-cpu" "pwr7" // RUN: %clang -target powerpc64-unknown-linux-gnu \ +// RUN: -### -S %s -mcpu=power8 2>&1 | FileCheck -check-prefix=PPCPWR8 %s +// PPCPWR8: clang +// PPCPWR8: "-cc1" +// PPCPWR8: "-target-cpu" "pwr8" + +// RUN: %clang -target powerpc64-unknown-linux-gnu \ // RUN: -### -S %s -mcpu=a2q 2>&1 | FileCheck -check-prefix=PPCA2Q %s // PPCA2Q: clang // PPCA2Q: "-cc1" diff --git a/tools/clang/test/Driver/ppc-features.cpp b/tools/clang/test/Driver/ppc-features.cpp index a7ccedf..fa9a7ec 100644 --- a/tools/clang/test/Driver/ppc-features.cpp +++ b/tools/clang/test/Driver/ppc-features.cpp @@ -59,9 +59,12 @@ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=pwr7 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-14 %s // CHECK-14: "-target-feature" "-altivec" -// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=ppc64 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-15 %s +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=pwr8 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-15 %s // CHECK-15: "-target-feature" "-altivec" +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=ppc64 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-16 %s +// CHECK-16: "-target-feature" "-altivec" + // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-qpx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOQPX %s // CHECK-NOQPX: "-target-feature" "-qpx" diff --git a/tools/clang/test/Preprocessor/init.c b/tools/clang/test/Preprocessor/init.c index ed08854..2db4183 100644 --- a/tools/clang/test/Preprocessor/init.c +++ b/tools/clang/test/Preprocessor/init.c @@ -2835,6 +2835,34 @@ // PPCPOWER7:#define _ARCH_PWR6X 1 // PPCPOWER7:#define _ARCH_PWR7 1 // +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr8 -fno-signed-char < /dev/null | FileCheck -check-prefix PPCPWR8 %s +// +// PPCPWR8:#define _ARCH_PPC 1 +// PPCPWR8:#define _ARCH_PPC64 1 +// PPCPWR8:#define _ARCH_PPCGR 1 +// PPCPWR8:#define _ARCH_PPCSQ 1 +// PPCPWR8:#define _ARCH_PWR4 1 +// PPCPWR8:#define _ARCH_PWR5 1 +// PPCPWR8:#define _ARCH_PWR5X 1 +// PPCPWR8:#define _ARCH_PWR6 1 +// PPCPWR8:#define _ARCH_PWR6X 1 +// PPCPWR8:#define _ARCH_PWR7 1 +// PPCPWR8:#define _ARCH_PWR8 1 +// +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power8 -fno-signed-char < /dev/null | FileCheck -check-prefix PPCPOWER8 %s +// +// PPCPOWER8:#define _ARCH_PPC 1 +// PPCPOWER8:#define _ARCH_PPC64 1 +// PPCPOWER8:#define _ARCH_PPCGR 1 +// PPCPOWER8:#define _ARCH_PPCSQ 1 +// PPCPOWER8:#define _ARCH_PWR4 1 +// PPCPOWER8:#define _ARCH_PWR5 1 +// PPCPOWER8:#define _ARCH_PWR5X 1 +// PPCPOWER8:#define _ARCH_PWR6 1 +// PPCPOWER8:#define _ARCH_PWR6X 1 +// PPCPOWER8:#define _ARCH_PWR7 1 +// PPCPOWER8:#define _ARCH_PWR8 1 +// // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-linux-gnu -fno-signed-char < /dev/null | FileCheck -check-prefix PPC64-LINUX %s // // PPC64-LINUX:#define _ARCH_PPC 1