summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-26 17:00:31 -0800
committerGitHub <noreply@github.com>2024-02-26 17:00:31 -0800
commit39522159c245e32a99cfdc47f03236f7028f5c61 (patch)
tree4ae93fb32f267f7caa5ce55a6a52aac9f1f33bdd /tests
parent1d8e93cd434f0c7acbb6db747b32c3a3720c5c2e (diff)
Allow default values for `extern` symbols. (#3632)
* Allow default values for `extern` symbols. * Fix. * Fix test.
Diffstat (limited to 'tests')
-rw-r--r--tests/diagnostics/unresolved-symbol.slang18
-rw-r--r--tests/ir/string-literal-hash-reflection.slang5
-rw-r--r--tests/library/export-test.slang6
-rw-r--r--tests/library/library-test.slang6
4 files changed, 28 insertions, 7 deletions
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<int> output;
+
+void main()
+{
+ Foo f;
+ output[0] = c + f.doThing();
+} \ No newline at end of file
diff --git a/tests/ir/string-literal-hash-reflection.slang b/tests/ir/string-literal-hash-reflection.slang
index a0a28876b..44a0f36e9 100644
--- a/tests/ir/string-literal-hash-reflection.slang
+++ b/tests/ir/string-literal-hash-reflection.slang
@@ -1,4 +1,7 @@
-//TEST:REFLECTION:-stage compute -entry computeMain -target hlsl -no-codegen
+//TEST:REFLECTION(filecheck=CHECK):-stage compute -entry computeMain -target hlsl -no-codegen
+
+// CHECK-DAG: "Hello \t\n\0x083 World": -215446506
+// CHECK-DAG: "Try another": 900483678
import string_literal_module;
diff --git a/tests/library/export-test.slang b/tests/library/export-test.slang
index a85396126..c2bb7810e 100644
--- a/tests/library/export-test.slang
+++ b/tests/library/export-test.slang
@@ -5,12 +5,12 @@
// This didn't work for lib_6_2 when compiling via DXC (!). Even though it's stated elsewhere the feature is available from 6.1
-//TEST:COMPILE: tests/library/export-library.slang -profile lib_6_3 -target dxil -o tests/library/export-library.dxil
-//TEST:COMPILE: tests/library/export-test.slang -entry computeMain -profile cs_6_3 -target dxil -r tests/library/export-library.dxil -o tests/library/export-test.dxil
+//TEST:COMPILE: tests/library/export-library.slang -incomplete-library -profile lib_6_3 -target dxil -o tests/library/export-library.dxil
+//TEST:COMPILE: tests/library/export-test.slang -incomplete-library -entry computeMain -profile cs_6_3 -target dxil -r tests/library/export-library.dxil -o tests/library/export-test.dxil
// Test the produced kernel.
-//TEST:COMPARE_COMPUTE_EX:-slang -compute -profile cs_6_3 -dx12 -use-dxil -shaderobj -Xslang... -r tests/library/export-library.dxil -X.
+//TEST:COMPARE_COMPUTE_EX:-slang -compute -profile cs_6_3 -dx12 -use-dxil -shaderobj -Xslang... -r tests/library/export-library.dxil -incomplete-library -X.
extern int foo(int a);
diff --git a/tests/library/library-test.slang b/tests/library/library-test.slang
index 3543ced10..e128b6c7c 100644
--- a/tests/library/library-test.slang
+++ b/tests/library/library-test.slang
@@ -5,12 +5,12 @@
// This didn't work for lib_6_2 when compiling via DXC (!). Even though it's stated elsewhere the feature is available from 6.1
-//TEST:COMPILE: tests/library/library.slang -profile lib_6_3 -target dxil -o tests/library/library.dxil
-//TEST:COMPILE: tests/library/library-test.slang -entry computeMain -profile cs_6_3 -target dxil -r tests/library/library.dxil -o tests/library/library-test.dxil
+//TEST:COMPILE: tests/library/library.slang -incomplete-library -profile lib_6_3 -target dxil -o tests/library/library.dxil
+//TEST:COMPILE: tests/library/library-test.slang -incomplete-library -entry computeMain -profile cs_6_3 -target dxil -r tests/library/library.dxil -o tests/library/library-test.dxil
// Test the produced kernel.
-//TEST:COMPARE_COMPUTE_EX:-slang -compute -profile cs_6_3 -dx12 -use-dxil -shaderobj -Xslang... -r tests/library/library.dxil -X.
+//TEST:COMPARE_COMPUTE_EX:-slang -compute -profile cs_6_3 -dx12 -use-dxil -shaderobj -Xslang... -r tests/library/library.dxil -incomplete-library -X.
extern int foo(int a);