diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-03-24 23:44:42 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-03-24 23:44:42 +0000 |
commit | 6ba3831ebeb147823e7ef0b62a42b558cbafc3da (patch) | |
tree | 6673cb14c359846293ea35ffa2e8c99a29d39318 /clang/test/CodeGenOpenCL | |
parent | 96966c7bf554e693fae804932e1e3ab431d4ea2d (diff) | |
download | bcm5719-llvm-6ba3831ebeb147823e7ef0b62a42b558cbafc3da.tar.gz bcm5719-llvm-6ba3831ebeb147823e7ef0b62a42b558cbafc3da.zip |
[CodeGen] Support native half inc/dec amounts.
We previously defaulted to long double, but it's also possible to have
a half inc/dec amount, when LangOpts NativeHalfType is set.
Currently, that's only true for OpenCL.
llvm-svn: 233135
Diffstat (limited to 'clang/test/CodeGenOpenCL')
-rw-r--r-- | clang/test/CodeGenOpenCL/half.cl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CodeGenOpenCL/half.cl b/clang/test/CodeGenOpenCL/half.cl index 7ecae894d03..bd5ae7f6499 100644 --- a/clang/test/CodeGenOpenCL/half.cl +++ b/clang/test/CodeGenOpenCL/half.cl @@ -13,3 +13,11 @@ half test() return z; // CHECK: half 0xH3260 } + +// CHECK-LABEL: @test_inc(half %x) +// CHECK: [[INC:%.*]] = fadd half %x, 0xH3C00 +// CHECK: ret half [[INC]] +half test_inc(half x) +{ + return ++x; +} |