From 1343ab79fcd0ff9e5ffebbcf95414e51ab19e9cd Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 25 Jul 2024 11:49:07 -0700 Subject: Fix around extensions and `IDifferentiable` requirement synthesis. (#4729) * Check extensions before function parameters. Fix decl ref formation for synthesized differentiable requirements that are inside an extension. * Fix clang errors. * More clang fix. * Fix warnings. * Fix build error. * Fix. * Fix typo. --- tests/bugs/extended-type-in-param.slang | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/bugs/extended-type-in-param.slang (limited to 'tests') diff --git a/tests/bugs/extended-type-in-param.slang b/tests/bugs/extended-type-in-param.slang new file mode 100644 index 000000000..b3631d36e --- /dev/null +++ b/tests/bugs/extended-type-in-param.slang @@ -0,0 +1,28 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv +struct ArrayLike +{ +} +__generic +extension ArrayLike : IDifferentiable +{ +} + +struct ExpectsDiff +{ +} + +// test that using `ExpectsDiff>` is fine to the type system. +// this means that we must have checked the extension for `ArrayLike` before +// we check the `t3` parameter for `test`. +void test(ExpectsDiff> t3) +{ +} + +// CHECK: OpEntryPoint + +[numthreads(1, 1, 1)] +void main() +{ + ExpectsDiff> v = {}; + test(v); +} \ No newline at end of file -- cgit v1.2.3