summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/slang/slang.cpp3
-rw-r--r--tests/bugs/missing-import-attribution.slang19
2 files changed, 19 insertions, 3 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 6ee50251a..2c76f035c 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -4472,9 +4472,6 @@ RefPtr<Module> Linkage::loadSourceModuleImpl(
if (errorCountAfter != errorCountBefore && !isInLanguageServer())
{
_diagnoseErrorInImportedModule(sink);
- }
- if (errorCountAfter && !isInLanguageServer())
- {
// Something went wrong during the parsing, so we should bail out.
return nullptr;
}
diff --git a/tests/bugs/missing-import-attribution.slang b/tests/bugs/missing-import-attribution.slang
new file mode 100644
index 000000000..8b5568660
--- /dev/null
+++ b/tests/bugs/missing-import-attribution.slang
@@ -0,0 +1,19 @@
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target hlsl -entry computeMain -stage compute
+
+import this_file_does_not_exist;
+
+import empty;
+
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=16):out
+RWStructuredBuffer<int> outputBuffer;
+
+// CHECK-NOT: error 1: {{.*}} 'empty.slang'
+
+[numthreads(4, 4, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ int index = dispatchThreadID.x;
+ outputBuffer[index] = index;
+}
+