diff options
| author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2013-02-01 14:45:29 +0000 |
|---|---|---|
| committer | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2013-02-01 14:45:29 +0000 |
| commit | 102bb32bf7ec168157dfaea61ae065ed0b99ec06 (patch) | |
| tree | 64a4875173e69855fa8d2a92ad08bd3a6c757485 | |
| parent | 87c6bb97162aaa9a9124f2af7dda411bac6f75fd (diff) | |
| download | bcm5719-llvm-102bb32bf7ec168157dfaea61ae065ed0b99ec06.tar.gz bcm5719-llvm-102bb32bf7ec168157dfaea61ae065ed0b99ec06.zip | |
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
| -rw-r--r-- | clang/test/CodeGen/ppc-no-altivec.c | 12 | ||||
| -rw-r--r-- | clang/test/Driver/altivec.cpp | 49 |
2 files changed, 49 insertions, 12 deletions
diff --git a/clang/test/CodeGen/ppc-no-altivec.c b/clang/test/CodeGen/ppc-no-altivec.c deleted file mode 100644 index 1830f268dd3..00000000000 --- 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 4e6fbe59727..cf70e8daa98 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" + |

