From 6ba3831ebeb147823e7ef0b62a42b558cbafc3da Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Tue, 24 Mar 2015 23:44:42 +0000 Subject: [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 --- clang/test/CodeGenOpenCL/half.cl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/test/CodeGenOpenCL') 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; +} -- cgit v1.2.3