• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 %s -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
2
3#pragma OPENCL EXTENSION cl_khr_fp16 : enable
4
5
6half 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}
16
17// CHECK-LABEL: @test_inc(half %x)
18// CHECK: [[INC:%.*]] = fadd half %x, 0xH3C00
19// CHECK: ret half [[INC]]
20half test_inc(half x)
21{
22  return ++x;
23}
24