summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-07-22 16:14:07 -0700
committerGitHub <noreply@github.com>2025-07-22 23:14:07 +0000
commit165a95ebb2e9dbdc1b92bdc103470438a5114500 (patch)
tree31318fc5633d5596c5ed3c7c910e690d9fd6ca8f /tests
parent8a36695f1f3abaf98831d4512e74ebd5bce1494e (diff)
Fix visibility of synthesized Differential typedefs. (#7865)
* Fix visibility of synthesized `Differential` typedefs. * Delete incorrect test.
Diffstat (limited to 'tests')
-rw-r--r--tests/autodiff/differential-visibility.slang26
-rw-r--r--tests/diagnostics/internal-visibility/interface-default-visibility.slang14
2 files changed, 26 insertions, 14 deletions
diff --git a/tests/autodiff/differential-visibility.slang b/tests/autodiff/differential-visibility.slang
new file mode 100644
index 000000000..368155678
--- /dev/null
+++ b/tests/autodiff/differential-visibility.slang
@@ -0,0 +1,26 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+// CHECK: OpEntryPoint
+public interface IBSDF
+{
+ public float3 get_value();
+}
+
+public struct AnisotropicGGX // : IDifferentiable
+{
+ float2 alpha = {};
+ public __init() { }
+};
+
+public struct TestDiffVisibility : IBSDF, IDifferentiable
+{
+ public AnisotropicGGX D = {};
+ public __init() { }
+ public float3 get_value() { return { 0.3 }; }
+};
+
+[numthreads(1,1,1)]
+void main()
+{
+ TestDiffVisibility test = {};
+ test.get_value();
+}
diff --git a/tests/diagnostics/internal-visibility/interface-default-visibility.slang b/tests/diagnostics/internal-visibility/interface-default-visibility.slang
deleted file mode 100644
index 79df14143..000000000
--- a/tests/diagnostics/internal-visibility/interface-default-visibility.slang
+++ /dev/null
@@ -1,14 +0,0 @@
-//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
-
-module m;
-
-public interface IFoo
-{
- void foo(); // Should have public visibility by default.
-}
-
-public struct F : IFoo
-{
- // CHECK:{{.*}}(13): error 30602:
- void foo() {};
-}