diff options
author | Chuanbo Weng <chuanbo.weng@intel.com> | 2014-11-03 16:15:39 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-11-06 15:15:31 +0800 |
commit | 989db5d3ae65a239372fd70d1ca9f23c3d8e93f3 (patch) | |
tree | be2a38da8db93b8cc875281164be5d52f7650f9e /kernels | |
parent | f7bb37ca22ba891550c91dc06154169e92bad90d (diff) | |
download | beignet-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.cl | 12 |
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; +} |