[cfe-commits] r134570 - /cfe/trunk/test/CodeGenOpenCL/2011-04-15-vec-init-from-vec.cl

Tanya Lattner tonic at nondot.org
Wed Jul 6 17:12:54 PDT 2011


Author: tbrethou
Date: Wed Jul  6 19:12:54 2011
New Revision: 134570

URL: http://llvm.org/viewvc/llvm-project?rev=134570&view=rev
Log:
Do not violate the opencl casting rules. This test case still illustrates the problem. In the future, we should throw an error when doing invalid casting.

Modified:
    cfe/trunk/test/CodeGenOpenCL/2011-04-15-vec-init-from-vec.cl

Modified: cfe/trunk/test/CodeGenOpenCL/2011-04-15-vec-init-from-vec.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/2011-04-15-vec-init-from-vec.cl?rev=134570&r1=134569&r2=134570&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenOpenCL/2011-04-15-vec-init-from-vec.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/2011-04-15-vec-init-from-vec.cl Wed Jul  6 19:12:54 2011
@@ -1,12 +1,11 @@
 // RUN: %clang_cc1 %s -emit-llvm -o %t
 
 typedef __attribute__((ext_vector_type(4)))  unsigned char uchar4;
-typedef __attribute__((ext_vector_type(4)))  unsigned int int4;
 typedef __attribute__((ext_vector_type(8))) unsigned char uchar8;
 
 // OpenCL allows vectors to be initialized by vectors Handle bug in
 // VisitInitListExpr for this case below.
-void foo( int4 v )
+void foo( uchar8 x )
 {
-  uchar4 val[4] = {{(uchar4){((uchar8)(v.lo)).lo}}};
-}
\ No newline at end of file
+  uchar4 val[4] = {{(uchar4){x.lo}}};
+}





More information about the cfe-commits mailing list