summaryrefslogtreecommitdiff
path: root/kernels
diff options
context:
space:
mode:
authorChuanbo Weng <chuanbo.weng@intel.com>2014-11-03 16:15:39 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-11-06 15:15:31 +0800
commit989db5d3ae65a239372fd70d1ca9f23c3d8e93f3 (patch)
treebe2a38da8db93b8cc875281164be5d52f7650f9e /kernels
parentf7bb37ca22ba891550c91dc06154169e92bad90d (diff)
downloadbeignet-989db5d3ae65a239372fd70d1ca9f23c3d8e93f3.tar.gz
utest: add new test that trigger an assignment operation bug in if.
This test case shows that assignment operation in if block seems does not affect lvalue. Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'kernels')
-rw-r--r--kernels/compiler_assignment_operation_in_if.cl12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernels/compiler_assignment_operation_in_if.cl b/kernels/compiler_assignment_operation_in_if.cl
new file mode 100644
index 00000000..d05a663a
--- /dev/null
+++ b/kernels/compiler_assignment_operation_in_if.cl
@@ -0,0 +1,12 @@
+__kernel
+void compiler_assignment_operation_in_if(__global int *dst){
+ int gidx = (int)get_global_id(0);
+
+ int3 d1 = (int3) (gidx, gidx-1, gidx-3);
+ int k = gidx % 5;
+ if (k == 1){
+ d1.x = d1.y;
+ }
+ global int * addr = dst + gidx;
+ *addr = d1.x;
+}