Re: [PATCH] D17955: [OpenCL] Fix pipe builtin bugs

2016-03-29 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL264825: [OpenCL] Fix pipe builtin bugs (authored by pxl).

Changed prior to commit:
  http://reviews.llvm.org/D17955?vs=51629=52021#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17955

Files:
  cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
  cfe/trunk/lib/Sema/SemaChecking.cpp
  cfe/trunk/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl

Index: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
===
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
@@ -7776,7 +7776,7 @@
 def err_opencl_builtin_pipe_arg_num : Error<
   "invalid number of arguments to function: %0">;
 def err_opencl_builtin_pipe_invalid_arg : Error<
-  "invalid argument type to function %0 (expecting %1)">;
+  "invalid argument type to function %0 (expecting %1 having %2)">;
 def err_opencl_builtin_pipe_invalid_access_modifier : Error<
   "invalid pipe access modifier (expecting %0)">;
 
Index: cfe/trunk/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
===
--- cfe/trunk/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
+++ cfe/trunk/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
@@ -5,46 +5,56 @@
   reserve_id_t rid;
 
   // read/write_pipe
+  read_pipe(p, );
+  read_pipe(p, ptr);
   read_pipe(tmp, p);// expected-error {{first argument to 'read_pipe' must be a pipe type}}
   read_pipe(p);   // expected-error {{invalid number of arguments to function: 'read_pipe'}}
-  read_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'reserve_id_t')}}
-  read_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'unsigned int')}}
-  read_pipe(p, tmp);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'int *')}}
+  read_pipe(p, rid, tmp, ptr);
+  read_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'reserve_id_t' having 'int')}}
+  read_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'unsigned int' having 'reserve_id_t')}}
+  read_pipe(p, tmp);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'int *' having 'int')}}
   write_pipe(p, ptr);// expected-error {{invalid pipe access modifier (expecting write_only)}}
   write_pipe(p, rid, tmp, ptr);// expected-error {{invalid pipe access modifier (expecting write_only)}}
 
   // reserve_read/write_pipe
-  reserve_read_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_read_pipe' (expecting 'unsigned int')}}
+  reserve_read_pipe(p, tmp);
+  reserve_read_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_read_pipe' (expecting 'unsigned int' having '__global int *')}}
   work_group_reserve_read_pipe(tmp, tmp);// expected-error{{first argument to 'work_group_reserve_read_pipe' must be a pipe type}}
   sub_group_reserve_write_pipe(p, tmp);// expected-error{{invalid pipe access modifier (expecting write_only)}}
 
   // commit_read/write_pipe
+  commit_read_pipe(p, rid);
   commit_read_pipe(tmp, rid);// expected-error{{first argument to 'commit_read_pipe' must be a pipe type}}
-  work_group_commit_read_pipe(p, tmp);// expected-error{{invalid argument type to function 'work_group_commit_read_pipe' (expecting 'reserve_id_t')}}
+  work_group_commit_read_pipe(p, tmp);// expected-error{{invalid argument type to function 'work_group_commit_read_pipe' (expecting 'reserve_id_t' having 'int')}}
   sub_group_commit_write_pipe(p, tmp);// expected-error{{invalid pipe access modifier (expecting write_only)}}
 }
 
 void test2(write_only pipe int p, global int* ptr){
   int tmp;
   reserve_id_t rid;
 
   // read/write_pipe
+  write_pipe(p, );
+  write_pipe(p, ptr);
   write_pipe(tmp, p);// expected-error {{first argument to 'write_pipe' must be a pipe type}}
   write_pipe(p);   // expected-error {{invalid number of arguments to function: 'write_pipe'}}
-  write_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'reserve_id_t')}}
-  write_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'unsigned int')}}
-  write_pipe(p, tmp);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'int *')}}
+  write_pipe(p, rid, tmp, ptr);
+  write_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'reserve_id_t' having 'int')}}
+  write_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'unsigned int' having 'reserve_id_t')}}
+  write_pipe(p, tmp);   // expected-error 

Re: [PATCH] D17955: [OpenCL] Fix pipe builtin bugs

2016-03-29 Thread Anastasia Stulova via cfe-commits
Anastasia accepted this revision.
Anastasia added a comment.

LGTM!


http://reviews.llvm.org/D17955



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17955: [OpenCL] Fix pipe builtin bugs

2016-03-24 Thread Xiuli PAN via cfe-commits
pxli168 updated this revision to Diff 51629.
pxli168 added a comment.

Add test for correct case.


http://reviews.llvm.org/D17955

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Sema/SemaChecking.cpp
  test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl

Index: test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
===
--- test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
+++ test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
@@ -5,46 +5,56 @@
   reserve_id_t rid;
 
   // read/write_pipe
+  read_pipe(p, );
+  read_pipe(p, ptr);
   read_pipe(tmp, p);// expected-error {{first argument to 'read_pipe' must be a pipe type}}
   read_pipe(p);   // expected-error {{invalid number of arguments to function: 'read_pipe'}}
-  read_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'reserve_id_t')}}
-  read_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'unsigned int')}}
-  read_pipe(p, tmp);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'int *')}}
+  read_pipe(p, rid, tmp, ptr);
+  read_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'reserve_id_t' having 'int')}}
+  read_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'unsigned int' having 'reserve_id_t')}}
+  read_pipe(p, tmp);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'int *' having 'int')}}
   write_pipe(p, ptr);// expected-error {{invalid pipe access modifier (expecting write_only)}}
   write_pipe(p, rid, tmp, ptr);// expected-error {{invalid pipe access modifier (expecting write_only)}}
 
   // reserve_read/write_pipe
-  reserve_read_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_read_pipe' (expecting 'unsigned int')}}
+  reserve_read_pipe(p, tmp);
+  reserve_read_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_read_pipe' (expecting 'unsigned int' having '__global int *')}}
   work_group_reserve_read_pipe(tmp, tmp);// expected-error{{first argument to 'work_group_reserve_read_pipe' must be a pipe type}}
   sub_group_reserve_write_pipe(p, tmp);// expected-error{{invalid pipe access modifier (expecting write_only)}}
 
   // commit_read/write_pipe
+  commit_read_pipe(p, rid);
   commit_read_pipe(tmp, rid);// expected-error{{first argument to 'commit_read_pipe' must be a pipe type}}
-  work_group_commit_read_pipe(p, tmp);// expected-error{{invalid argument type to function 'work_group_commit_read_pipe' (expecting 'reserve_id_t')}}
+  work_group_commit_read_pipe(p, tmp);// expected-error{{invalid argument type to function 'work_group_commit_read_pipe' (expecting 'reserve_id_t' having 'int')}}
   sub_group_commit_write_pipe(p, tmp);// expected-error{{invalid pipe access modifier (expecting write_only)}}
 }
 
 void test2(write_only pipe int p, global int* ptr){
   int tmp;
   reserve_id_t rid;
 
   // read/write_pipe
+  write_pipe(p, );
+  write_pipe(p, ptr);
   write_pipe(tmp, p);// expected-error {{first argument to 'write_pipe' must be a pipe type}}
   write_pipe(p);   // expected-error {{invalid number of arguments to function: 'write_pipe'}}
-  write_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'reserve_id_t')}}
-  write_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'unsigned int')}}
-  write_pipe(p, tmp);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'int *')}}
+  write_pipe(p, rid, tmp, ptr);
+  write_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'reserve_id_t' having 'int')}}
+  write_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'unsigned int' having 'reserve_id_t')}}
+  write_pipe(p, tmp);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'int *' having 'int')}}
   read_pipe(p, ptr);// expected-error {{invalid pipe access modifier (expecting read_only)}}
   read_pipe(p, rid, tmp, ptr);// expected-error {{invalid pipe access modifier (expecting read_only)}}
 
   // reserve_read/write_pipe
-  reserve_write_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_write_pipe' (expecting 'unsigned int')}}
+  reserve_write_pipe(p, tmp);
+  reserve_write_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_write_pipe' (expecting 'unsigned int' having '__global int *')}}
   work_group_reserve_write_pipe(tmp, tmp);// expected-error{{first argument to 'work_group_reserve_write_pipe' must be a pipe type}}
   sub_group_reserve_read_pipe(p, tmp);// expected-error{{invalid pipe 

Re: [PATCH] D17955: [OpenCL] Fix pipe builtin bugs

2016-03-22 Thread Anastasia Stulova via cfe-commits
Anastasia added inline comments.


Comment at: test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl:1
@@ -1,2 +1,2 @@
 // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
 

Could you add a test case that fails before your modification here to show that 
your change improves on it!


http://reviews.llvm.org/D17955



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17955: [OpenCL] Fix pipe builtin bugs

2016-03-22 Thread Yaxun Liu via cfe-commits
yaxunl accepted this revision.
yaxunl added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks.


http://reviews.llvm.org/D17955



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17955: [OpenCL] Fix pipe builtin bugs

2016-03-21 Thread Xiuli PAN via cfe-commits
pxli168 updated this revision to Diff 51140.
pxli168 added a comment.

Refine other check using the changed diag.
Change test as well.


http://reviews.llvm.org/D17955

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Sema/SemaChecking.cpp
  test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl

Index: test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
===
--- test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
+++ test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
@@ -7,20 +7,20 @@
   // read/write_pipe
   read_pipe(tmp, p);// expected-error {{first argument to 'read_pipe' must be a pipe type}}
   read_pipe(p);   // expected-error {{invalid number of arguments to function: 'read_pipe'}}
-  read_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'reserve_id_t')}}
-  read_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'unsigned int')}}
-  read_pipe(p, tmp);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'int *')}}
+  read_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'reserve_id_t' having 'int')}}
+  read_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'unsigned int' having 'reserve_id_t')}}
+  read_pipe(p, tmp);   // expected-error {{invalid argument type to function 'read_pipe' (expecting 'int *' having 'int')}}
   write_pipe(p, ptr);// expected-error {{invalid pipe access modifier (expecting write_only)}}
   write_pipe(p, rid, tmp, ptr);// expected-error {{invalid pipe access modifier (expecting write_only)}}
 
   // reserve_read/write_pipe
-  reserve_read_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_read_pipe' (expecting 'unsigned int')}}
+  reserve_read_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_read_pipe' (expecting 'unsigned int' having '__global int *')}}
   work_group_reserve_read_pipe(tmp, tmp);// expected-error{{first argument to 'work_group_reserve_read_pipe' must be a pipe type}}
   sub_group_reserve_write_pipe(p, tmp);// expected-error{{invalid pipe access modifier (expecting write_only)}}
 
   // commit_read/write_pipe
   commit_read_pipe(tmp, rid);// expected-error{{first argument to 'commit_read_pipe' must be a pipe type}}
-  work_group_commit_read_pipe(p, tmp);// expected-error{{invalid argument type to function 'work_group_commit_read_pipe' (expecting 'reserve_id_t')}}
+  work_group_commit_read_pipe(p, tmp);// expected-error{{invalid argument type to function 'work_group_commit_read_pipe' (expecting 'reserve_id_t' having 'int')}}
   sub_group_commit_write_pipe(p, tmp);// expected-error{{invalid pipe access modifier (expecting write_only)}}
 }
 
@@ -31,20 +31,20 @@
   // read/write_pipe
   write_pipe(tmp, p);// expected-error {{first argument to 'write_pipe' must be a pipe type}}
   write_pipe(p);   // expected-error {{invalid number of arguments to function: 'write_pipe'}}
-  write_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'reserve_id_t')}}
-  write_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'unsigned int')}}
-  write_pipe(p, tmp);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'int *')}}
+  write_pipe(p, tmp, tmp, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'reserve_id_t' having 'int')}}
+  write_pipe(p, rid, rid, ptr);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'unsigned int' having 'reserve_id_t')}}
+  write_pipe(p, tmp);   // expected-error {{invalid argument type to function 'write_pipe' (expecting 'int *' having 'int')}}
   read_pipe(p, ptr);// expected-error {{invalid pipe access modifier (expecting read_only)}}
   read_pipe(p, rid, tmp, ptr);// expected-error {{invalid pipe access modifier (expecting read_only)}}
 
   // reserve_read/write_pipe
-  reserve_write_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_write_pipe' (expecting 'unsigned int')}}
+  reserve_write_pipe(p, ptr);// expected-error{{invalid argument type to function 'reserve_write_pipe' (expecting 'unsigned int' having '__global int *')}}
   work_group_reserve_write_pipe(tmp, tmp);// expected-error{{first argument to 'work_group_reserve_write_pipe' must be a pipe type}}
   sub_group_reserve_read_pipe(p, tmp);// expected-error{{invalid pipe access modifier (expecting read_only)}}
 
   // commit_read/write_pipe
   commit_write_pipe(tmp, rid);// expected-error{{first argument to 'commit_write_pipe' must be a pipe type}}
-  work_group_commit_write_pipe(p, tmp);// expected-error{{invalid argument type to function 

Re: [PATCH] D17955: [OpenCL] Fix pipe builtin bugs

2016-03-08 Thread Anastasia Stulova via cfe-commits
Anastasia added a comment.

Tests missing!


http://reviews.llvm.org/D17955



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits