Anastasia added a comment. @pekka.jaaskelainen, I just compiled the release 4.0 branch and it all works for me as expected: clang -cc1 -triple spir64-unknown-unknown test.cl clang -target spir64-unknown-unknown test.cl https://reviews.llvm.org/D28080