summaryrefslogtreecommitdiffstats
path: root/test/Driver
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-04-04 20:39:32 +0000
committerChad Rosier <mcrosier@apple.com>2012-04-04 20:39:32 +0000
commit7a938fa66be42710b034a79106de337a275fd265 (patch)
tree503e48f32b4b1acfc430766e4ccfca520752fb1e /test/Driver
parent878f8502ebea491b818b48e342f9ad9de2feaff6 (diff)
[driver] Create a new -mfpmath= option, which is used to control whether clang
uses Neon instructions for single-precision FP. -mfpmath=neon is analogous to passing llc -mattr=+neonfp. -mfpmath=[vfp|vfp2|vfp3|vfp4] is analogous to passing llc -mattr=-neonfp. rdar://11108618 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154046 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver')
-rw-r--r--test/Driver/arm-mfpmath.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Driver/arm-mfpmath.c b/test/Driver/arm-mfpmath.c
new file mode 100644
index 0000000000..ab1809385a
--- /dev/null
+++ b/test/Driver/arm-mfpmath.c
@@ -0,0 +1,25 @@
+// Test different values of -mfpmath.
+
+// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp %s -### -c -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-VFP %s
+// CHECK-VFP: "-target-feature" "-neonfp"
+
+// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp2 %s -### -c -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-VFP2 %s
+// CHECK-VFP2: "-target-feature" "-neonfp"
+
+// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp3 %s -### -c -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s
+// CHECK-VFP3: "-target-feature" "-neonfp"
+
+// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp4 %s -### -c -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-VFP4 %s
+// CHECK-VFP4: "-target-feature" "-neonfp"
+
+// RUN: %clang -target arm-apple-darwin10 -mfpmath=neon %s -### -c -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NEON %s
+// CHECK-NEON: "-target-feature" "+neonfp"
+
+// RUN: %clang -target arm-apple-darwin10 -mfpmath=foo %s -### -c -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ERROR %s
+// CHECK-ERROR: clang compiler does not support '-mfpmath=foo'