| 1 |
// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ |
| 2 |
// RUN: dxil-pc-shadermodel6.3-library %s \ |
| 3 |
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s |
| 4 |
|
| 5 |
// FIXME: add semantic to a. |
| 6 |
// See https://github.com/llvm/llvm-project/issues/57874 |
| 7 |
struct S { |
| 8 |
float a; |
| 9 |
}; |
| 10 |
|
| 11 |
|
| 12 |
// Make sure sret parameter is generated. |
| 13 |
// CHECK:define internal void @"?ps_main@@YA?AUS@@XZ"(ptr dead_on_unwind noalias writable sret(%struct.S) align 4 %agg.result) |
| 14 |
// FIXME: change it to real value instead of poison value once semantic is add to a. |
| 15 |
// Make sure the function with sret is called. |
| 16 |
// CHECK:call void @"?ps_main@@YA?AUS@@XZ"(ptr poison) |
| 17 |
[shader("pixel")] |
| 18 |
S ps_main() { |
| 19 |
S s; |
| 20 |
s.a = 0; |
| 21 |
return s; |
| 22 |
}; |