]> granicus.if.org Git - clang/commitdiff
[NFC][Clang] Add driver tests for sb and predres
authorDiogo N. Sampaio <diogo.sampaio@arm.com>
Fri, 25 Jan 2019 14:57:22 +0000 (14:57 +0000)
committerDiogo N. Sampaio <diogo.sampaio@arm.com>
Fri, 25 Jan 2019 14:57:22 +0000 (14:57 +0000)
Add tests that arguments for enabling/disabling
sb and predres are correctly being or not passed
by the driver.

Differential Revision: https://reviews.llvm.org/D57060

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352203 91177308-0d34-0410-b5e6-96231b3b80d8

test/Driver/aarch64-predres.c [new file with mode: 0644]
test/Driver/arm-sb.c [new file with mode: 0644]

diff --git a/test/Driver/aarch64-predres.c b/test/Driver/aarch64-predres.c
new file mode 100644 (file)
index 0000000..810ba62
--- /dev/null
@@ -0,0 +1,11 @@
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8a+predres     %s 2>&1 | FileCheck %s
+// CHECK: "-target-feature" "+predres"
+// CHECK-NOT: "-target-feature" "-predres"
+
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a+nopredres %s 2>&1 | FileCheck %s --check-prefix=NOPR
+// NOPR: "-target-feature" "-predres"
+// NOPR-NOT: "-target-feature" "+predres"
+
+// RUN: %clang -### -target aarch64-none-none-eabi                           %s 2>&1 | FileCheck %s --check-prefix=ABSENT
+// ABSENT-NOT: "-target-feature" "+predres"
+// ABSENT-NOT: "-target-feature" "-predres"
diff --git a/test/Driver/arm-sb.c b/test/Driver/arm-sb.c
new file mode 100644 (file)
index 0000000..3dc0f13
--- /dev/null
@@ -0,0 +1,14 @@
+// RUN: %clang -### -target arm-none-none-eabi -march=armv8a+sb %s 2>&1 | FileCheck %s
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8a+sb %s 2>&1 | FileCheck %s
+// CHECK: "-target-feature" "+sb"
+// CHECK-NOT: "-target-feature" "-sb"
+
+// RUN: %clang -### -target arm-none-none-eabi -march=armv8.5a+nosb %s 2>&1 | FileCheck %s --check-prefix=NOSB
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a+nosb %s 2>&1 | FileCheck %s --check-prefix=NOSB
+// NOSB: "-target-feature" "-sb"
+// NOSB-NOT: "-target-feature" "+sb"
+
+// RUN: %clang -### -target arm-none-none-eabi %s 2>&1 | FileCheck %s --check-prefix=ABSENT
+// RUN: %clang -### -target aarch64-none-none-eabi %s 2>&1 | FileCheck %s --check-prefix=ABSENT
+// ABSENT-NOT: "-target-feature" "+sb"
+// ABSENT-NOT: "-target-feature" "-sb"