r174176 - Revise unit testing for -fno-altivec, -mno-altivec.

Bill Schmidt wschmidt at linux.vnet.ibm.com
Fri Feb 1 06:45:29 PST 2013


Author: wschmidt
Date: Fri Feb  1 08:45:29 2013
New Revision: 174176

URL: http://llvm.org/viewvc/llvm-project?rev=174176&view=rev
Log:
Revise unit testing for -fno-altivec, -mno-altivec.

As suggested, reverted the end-to-end test and added variations to an
existing Driver test.

Removed:
    cfe/trunk/test/CodeGen/ppc-no-altivec.c
Modified:
    cfe/trunk/test/Driver/altivec.cpp

Removed: cfe/trunk/test/CodeGen/ppc-no-altivec.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ppc-no-altivec.c?rev=174175&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/ppc-no-altivec.c (original)
+++ cfe/trunk/test/CodeGen/ppc-no-altivec.c (removed)
@@ -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

Modified: cfe/trunk/test/Driver/altivec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/altivec.cpp?rev=174176&r1=174175&r2=174176&view=diff
==============================================================================
--- cfe/trunk/test/Driver/altivec.cpp (original)
+++ cfe/trunk/test/Driver/altivec.cpp Fri Feb  1 08:45:29 2013
@@ -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"
+





More information about the cfe-commits mailing list