[cfe-commits] r120694 - in /cfe/trunk/test: Headers/arm-neon-header.c Sema/arm-neon-types.c

Bob Wilson bob.wilson at apple.com
Wed Dec 1 23:13:32 PST 2010


Author: bwilson
Date: Thu Dec  2 01:13:31 2010
New Revision: 120694

URL: http://llvm.org/viewvc/llvm-project?rev=120694&view=rev
Log:
Add a test for calling a Neon intrinsic macro with the wrong vector type.
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.

Added:
    cfe/trunk/test/Sema/arm-neon-types.c
      - copied, changed from r120692, cfe/trunk/test/Headers/arm-neon-header.c
Modified:
    cfe/trunk/test/Headers/arm-neon-header.c

Modified: cfe/trunk/test/Headers/arm-neon-header.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/arm-neon-header.c?rev=120694&r1=120693&r2=120694&view=diff
==============================================================================
--- cfe/trunk/test/Headers/arm-neon-header.c (original)
+++ cfe/trunk/test/Headers/arm-neon-header.c Thu Dec  2 01:13:31 2010
@@ -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);
-}

Copied: cfe/trunk/test/Sema/arm-neon-types.c (from r120692, cfe/trunk/test/Headers/arm-neon-header.c)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/arm-neon-types.c?p2=cfe/trunk/test/Sema/arm-neon-types.c&p1=cfe/trunk/test/Headers/arm-neon-header.c&r1=120692&r2=120694&rev=120694&view=diff
==============================================================================
--- cfe/trunk/test/Headers/arm-neon-header.c (original)
+++ cfe/trunk/test/Sema/arm-neon-types.c Thu Dec  2 01:13:31 2010
@@ -1,6 +1,4 @@
 // RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s
-// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -fno-lax-vector-conversions -verify %s
-// RUN: %clang_cc1 -x c++ -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s
 
 #include <arm_neon.h>
 
@@ -8,3 +6,8 @@
 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}}
+}





More information about the cfe-commits mailing list