From 102bb32bf7ec168157dfaea61ae065ed0b99ec06 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Fri, 1 Feb 2013 14:45:29 +0000 Subject: [PATCH] Revise unit testing for -fno-altivec, -mno-altivec. As suggested, reverted the end-to-end test and added variations to an existing Driver test. llvm-svn: 174176 --- clang/test/CodeGen/ppc-no-altivec.c | 12 --------- clang/test/Driver/altivec.cpp | 49 +++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 12 deletions(-) delete mode 100644 clang/test/CodeGen/ppc-no-altivec.c diff --git a/clang/test/CodeGen/ppc-no-altivec.c b/clang/test/CodeGen/ppc-no-altivec.c deleted file mode 100644 index 1830f26..0000000 --- a/clang/test/CodeGen/ppc-no-altivec.c +++ /dev/null @@ -1,12 +0,0 @@ -// REQUIRES: ppc64-registered-target -// RUN: %clang_cc1 %s -triple=powerpc64-unknown-linux-gnu -S -o - | FileCheck %s - -typedef char v8qi __attribute__((vector_size (8))); - -extern v8qi x, y; - -v8qi foo (void) { - return x + y; -} - -// CHECK-NOT: lvx diff --git a/clang/test/Driver/altivec.cpp b/clang/test/Driver/altivec.cpp index 4e6fbe5..cf70e8d 100644 --- a/clang/test/Driver/altivec.cpp +++ b/clang/test/Driver/altivec.cpp @@ -13,3 +13,52 @@ // RUN: %clang -target sparc-unknown-solaris -faltivec -fsyntax-only %s 2>&1 | FileCheck %s // CHECK: invalid argument '-faltivec' only allowed with 'ppc/ppc64' + +// Check that -fno-altivec and -mno-altivec correctly disable the altivec +// target feature on powerpc. + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-1 %s +// CHECK-1: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-2 %s +// CHECK-2: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -faltivec -mno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-3 %s +// CHECK-3: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -maltivec -fno-altivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-4 %s +// CHECK-4: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-altivec -faltivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-5 %s +// CHECK-5-NOT: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -maltivec -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-6 %s +// CHECK-6-NOT: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=7400 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-7 %s +// CHECK-7: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=g4 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-8 %s +// CHECK-8: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=7450 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-9 %s +// CHECK-9: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=g4+ -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-10 %s +// CHECK-10: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=970 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-11 %s +// CHECK-11: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=g5 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-12 %s +// CHECK-12: "-target-feature" "-altivec" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=pwr6 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-13 %s +// CHECK-13: "-target-feature" "-altivec" + +// 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 +// CHECK-15: "-target-feature" "-altivec" + -- 2.7.4