]> granicus.if.org Git - clang/commit
[OpenCL] Fix casting a true boolean to an integer vector.
authorAnastasia Stulova <anastasia.stulova@arm.com>
Mon, 5 Oct 2015 11:27:41 +0000 (11:27 +0000)
committerAnastasia Stulova <anastasia.stulova@arm.com>
Mon, 5 Oct 2015 11:27:41 +0000 (11:27 +0000)
commitf671bbf2f6842afa4539231f05db91936d642718
tree4ff5a723ae294abeba27a396b02a6f5b150d8b9e
parentc73b622cce69768788d7ff0fe2e51addd9eaedd0
[OpenCL] Fix casting a true boolean to an integer vector.

OpenCL v1.1 s6.2.2: for the boolean value true, every bit in the result vector should be set.

This change treats the i1 value as signed for the purposes of performing the cast to integer,
and therefore sign extend into the result.

Patch by Neil Hickey!

http://reviews.llvm.org/D13349

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249301 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExprScalar.cpp
test/CodeGenOpenCL/bool_cast.cl [new file with mode: 0644]