Joey Gouly | dd7f456 | 2013-01-23 11:56:20 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s |
| 2 | |
| 3 | #pragma OPENCL EXTENSION cl_khr_fp16 : enable |
| 4 | |
| 5 | |
| 6 | half test() |
| 7 | { |
| 8 | half x = 0.1f; |
| 9 | x+=2.0f; |
| 10 | x-=2.0f; |
| 11 | half y = x + x; |
| 12 | half z = y * 1.0f; |
| 13 | return z; |
| 14 | // CHECK: half 0xH3260 |
| 15 | } |
Ahmed Bougacha | 6ba3831 | 2015-03-24 23:44:42 +0000 | [diff] [blame] | 16 | |
| 17 | // CHECK-LABEL: @test_inc(half %x) |
| 18 | // CHECK: [[INC:%.*]] = fadd half %x, 0xH3C00 |
| 19 | // CHECK: ret half [[INC]] |
| 20 | half test_inc(half x) |
| 21 | { |
| 22 | return ++x; |
| 23 | } |