Debian Codegraph @

clang/test/CodeGenHLSL/half.hlsl

raw
1 // RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
2 // RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
3 // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s --check-prefix=HALF
4
5 // RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
6 // RUN: dxil-pc-shadermodel6.3-library %s \
7 // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s --check-prefix=FLOAT
8
9
10 // Make sure use float when not enable-16bit-types.
11 // FLOAT:define {{.*}}float @_Z3fooDhDh(float{{[^,]+}}, float{{[^,)]+}})
12 // FLOAT-NOT:half
13 // FLOAT:ret float %
14
15 // Make sure use half when enable-16bit-types.
16 // HALF:define {{.*}}half @_Z3fooDhDh(half{{[^,]+}}, half{{[^,)]+}})
17 // HALF-NOT:float
18 // HALF:ret half %
19 half foo(half a, half b) {
20 return a+b;
21 }