42 lines · plain
1// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -fnative-int16-type -emit-llvm -O1 -o - | FileCheck %s2 3// CHECK: define {{.*}}test_uint{{.*}}(i32 {{.*}} [[VAL:%.*]]){{.*}}4// CHECK-NOT: bitcast5// CHECK: ret i32 [[VAL]]6uint test_uint(uint p0) {7 return asuint(p0);8}9 10// CHECK: define {{.*}}test_int{{.*}}(i32 {{.*}} [[VAL:%.*]]){{.*}}11// CHECK-NOT: bitcast12// CHECK: ret i32 [[VAL]]13uint test_int(int p0) {14 return asuint(p0);15}16 17// CHECK: define {{.*}}test_float{{.*}}(float {{.*}} [[VAL:%.*]]){{.*}}18// CHECK: bitcast float [[VAL]] to i3219uint test_float(float p0) {20 return asuint(p0);21}22 23// CHECK: define {{.*}}test_vector_uint{{.*}}(<4 x i32> {{.*}} [[VAL:%.*]]){{.*}}24// CHECK-NOT: bitcast25// CHECK: ret <4 x i32> [[VAL]]26uint4 test_vector_uint(uint4 p0) {27 return asuint(p0);28}29 30// CHECK: define {{.*}}test_vector_int{{.*}}(<4 x i32> {{.*}} [[VAL:%.*]]){{.*}}31// CHECK-NOT: bitcast32// CHECK: ret <4 x i32> [[VAL]]33uint4 test_vector_int(int4 p0) {34 return asuint(p0);35}36 37// CHECK: define {{.*}}test_vector_float{{.*}}(<4 x float> {{.*}} [[VAL:%.*]]){{.*}}38// CHECK: bitcast <4 x float> [[VAL]] to <4 x i32>39uint4 test_vector_float(float4 p0) {40 return asuint(p0);41}42