]> granicus.if.org Git - clang/commitdiff
Add a test for calling a Neon intrinsic macro with the wrong vector type.
authorBob Wilson <bob.wilson@apple.com>
Thu, 2 Dec 2010 07:13:31 +0000 (07:13 +0000)
committerBob Wilson <bob.wilson@apple.com>
Thu, 2 Dec 2010 07:13:31 +0000 (07:13 +0000)
This does not work so well with the -fno-lax-vector-conversions option for
testing the arm_neon.h header but that is a really useful test, so I split
this out to a separate Sema test to check for the warning.

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

test/Headers/arm-neon-header.c
test/Sema/arm-neon-types.c [new file with mode: 0644]

index 3f8b3d14362c41a980d3ea0f32a04ecc98a821c4..e11904111089e543b0d858c46312ea898a078523 100644 (file)
@@ -3,8 +3,3 @@
 // RUN: %clang_cc1 -x c++ -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s
 
 #include <arm_neon.h>
-
-// Radar 8228022: Should not report incompatible vector types.
-int32x2_t test(int32x2_t x) {
-  return vshr_n_s32(x, 31);
-}
diff --git a/test/Sema/arm-neon-types.c b/test/Sema/arm-neon-types.c
new file mode 100644 (file)
index 0000000..40513c4
--- /dev/null
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s
+
+#include <arm_neon.h>
+
+// Radar 8228022: Should not report incompatible vector types.
+int32x2_t test(int32x2_t x) {
+  return vshr_n_s32(x, 31);
+}
+
+// ...but should warn when the types really do not match.
+float32x2_t test2(uint32x2_t x) {
+  return vcvt_n_f32_s32(x, 0); // expected-warning {{incompatible vector types}}
+}