From 39522159c245e32a99cfdc47f03236f7028f5c61 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 26 Feb 2024 17:00:31 -0800 Subject: Allow default values for `extern` symbols. (#3632) * Allow default values for `extern` symbols. * Fix. * Fix test. --- tests/diagnostics/unresolved-symbol.slang | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/diagnostics/unresolved-symbol.slang (limited to 'tests/diagnostics') diff --git a/tests/diagnostics/unresolved-symbol.slang b/tests/diagnostics/unresolved-symbol.slang new file mode 100644 index 000000000..d5c8444fc --- /dev/null +++ b/tests/diagnostics/unresolved-symbol.slang @@ -0,0 +1,18 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target hlsl -entry main -profile cs_6_0 +interface IFoo +{ + int doThing(); +} + +// CHECK: ([[#@LINE+1]]): error 45001: +extern struct Foo : IFoo; +// CHECK: ([[#@LINE+1]]): error 45001: +extern static const int c; + +RWStructuredBuffer output; + +void main() +{ + Foo f; + output[0] = c + f.doThing(); +} \ No newline at end of file -- cgit v1.2.3