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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174176 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/ppc-no-altivec.c b/test/CodeGen/ppc-no-altivec.c
deleted file mode 100644
index 1830f26..0000000
--- a/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/test/Driver/altivec.cpp b/test/Driver/altivec.cpp
index 4e6fbe5..cf70e8d 100644
--- a/test/Driver/altivec.cpp
+++ b/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"
+