From dd980b492aba9ea1540193434184489d9d04608d Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 7 Aug 2020 18:36:01 -0700 Subject: AnyValue packing/unpacking pass. (#1480) * AnyValue packing/unpacking pass. * Add diagnostic for types that does not fit in required AnyValueSize. * Add expected test result * Fix warnings. --- .../interfaces/anyvalue-size-validation.slang | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/diagnostics/interfaces/anyvalue-size-validation.slang (limited to 'tests/diagnostics/interfaces/anyvalue-size-validation.slang') diff --git a/tests/diagnostics/interfaces/anyvalue-size-validation.slang b/tests/diagnostics/interfaces/anyvalue-size-validation.slang new file mode 100644 index 000000000..b7cd5ba34 --- /dev/null +++ b/tests/diagnostics/interfaces/anyvalue-size-validation.slang @@ -0,0 +1,29 @@ +// anyvalue-size-validation.slang + +//DIAGNOSTIC_TEST:SIMPLE:-target cpp -stage compute -entry main -allow-dynamic-code + +[anyValueSize(8)] +interface IInterface +{ + int doSomething(); +}; + +struct S : IInterface +{ + uint a; + uint b; + uint c; + int doSomething() { return 5; } +}; + +T test(T s) +{ + return s; +} + +[numthreads(4, 1, 1)] +void main() +{ + S s; + test(s); +} \ No newline at end of file -- cgit v1.2.3