summaryrefslogtreecommitdiff
path: root/tests/autodiff/custom-differential-type-error.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/autodiff/custom-differential-type-error.slang')
-rw-r--r--tests/autodiff/custom-differential-type-error.slang26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/autodiff/custom-differential-type-error.slang b/tests/autodiff/custom-differential-type-error.slang
new file mode 100644
index 000000000..2542eff4f
--- /dev/null
+++ b/tests/autodiff/custom-differential-type-error.slang
@@ -0,0 +1,26 @@
+//TEST:SIMPLE(filecheck=CHECK):-target spirv
+
+interface IFoo : IDifferentiable
+{
+ float myFunc();
+}
+
+struct Bar: IDifferentiable
+{
+ float y;
+}
+
+struct Foo : IFoo
+{
+ typealias Differential = Bar;
+
+ // CHECK: ([[# @LINE+1]]): error 30027: 'x' is not a member of 'typeof(Foo.Differential)'.
+ [DerivativeMember(Differential.x)]
+ float x;
+
+ [BackwardDifferentiable]
+ float myFunc()
+ {
+ return x * x;
+ };
+}