| 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 %s |
| 2 |
|
| 3 |
// CHECK: define {{.*}}test_uint{{.*}}(i32 {{.*}} [[VAL:%.*]]){{.*}} |
| 4 |
// CHECK-NOT: bitcast |
| 5 |
// CHECK: ret i32 [[VAL]] |
| 6 |
uint test_uint(uint p0) { |
| 7 |
return asuint(p0); |
| 8 |
} |
| 9 |
|
| 10 |
// CHECK: define {{.*}}test_int{{.*}}(i32 {{.*}} [[VAL:%.*]]){{.*}} |
| 11 |
// CHECK-NOT: bitcast |
| 12 |
// CHECK: ret i32 [[VAL]] |
| 13 |
uint test_int(int p0) { |
| 14 |
return asuint(p0); |
| 15 |
} |
| 16 |
|
| 17 |
// CHECK: define {{.*}}test_float{{.*}}(float {{.*}} [[VAL:%.*]]){{.*}} |
| 18 |
// CHECK: bitcast float [[VAL]] to i32 |
| 19 |
uint test_float(float p0) { |
| 20 |
return asuint(p0); |
| 21 |
} |
| 22 |
|
| 23 |
// CHECK: define {{.*}}test_vector_uint{{.*}}(<4 x i32> {{.*}} [[VAL:%.*]]){{.*}} |
| 24 |
// CHECK-NOT: bitcast |
| 25 |
// CHECK: ret <4 x i32> [[VAL]] |
| 26 |
uint4 test_vector_uint(uint4 p0) { |
| 27 |
return asuint(p0); |
| 28 |
} |
| 29 |
|
| 30 |
// CHECK: define {{.*}}test_vector_int{{.*}}(<4 x i32> {{.*}} [[VAL:%.*]]){{.*}} |
| 31 |
// CHECK-NOT: bitcast |
| 32 |
// CHECK: ret <4 x i32> [[VAL]] |
| 33 |
uint4 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> |
| 39 |
uint4 test_vector_float(float4 p0) { |
| 40 |
return asuint(p0); |
| 41 |
} |