From 9304c2d04c9bfbae33cc328d404b24aba375aa4f Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 21 Oct 2021 15:51:18 -0700 Subject: Diagnostic for no type conformance + bug fix. (#1985) * Diagnostic for no type conformance + bug fix. * Fixes. * Fix. * Include heterogeneous example only with --enable-experimental-projects premake flag Co-authored-by: Yong He Co-authored-by: jsmall-nvidia --- tests/diagnostics/no-type-conformance.slang | 19 +++++++++++++++++++ tests/diagnostics/no-type-conformance.slang.expected | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/diagnostics/no-type-conformance.slang create mode 100644 tests/diagnostics/no-type-conformance.slang.expected (limited to 'tests') diff --git a/tests/diagnostics/no-type-conformance.slang b/tests/diagnostics/no-type-conformance.slang new file mode 100644 index 000000000..ada4f663a --- /dev/null +++ b/tests/diagnostics/no-type-conformance.slang @@ -0,0 +1,19 @@ +//DIAGNOSTIC_TEST:COMMAND_LINE_SIMPLE:-target hlsl -entry computeMain -stage compute -o no-type-conformance.hlsl +// no type conformance linked + +interface IFoo +{ + float get(); +} + +void foo() +{ + IFoo obj; + obj.get(); +} + +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + foo(); +} \ No newline at end of file diff --git a/tests/diagnostics/no-type-conformance.slang.expected b/tests/diagnostics/no-type-conformance.slang.expected new file mode 100644 index 000000000..bc38fa7f1 --- /dev/null +++ b/tests/diagnostics/no-type-conformance.slang.expected @@ -0,0 +1,8 @@ +result code = -1 +standard error = { +tests/diagnostics/no-type-conformance.slang(4): error 50100: No type conformances are found for interface 'IFoo'. Code generation for current target requires at least one implementation type present in the linkage. +interface IFoo + ^~~~ +} +standard output = { +} -- cgit v1.2.3