diff options
Diffstat (limited to 'tests/library/export-library-generics.slang')
| -rw-r--r-- | tests/library/export-library-generics.slang | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/library/export-library-generics.slang b/tests/library/export-library-generics.slang new file mode 100644 index 000000000..f88541da3 --- /dev/null +++ b/tests/library/export-library-generics.slang @@ -0,0 +1,39 @@ +//TEST_IGNORE_FILE: + +// export-library-generics.slang + +module "export-library-generics"; + +public cbuffer Constants { + public float x; + public float y; +} + +interface MyInterface +{ + int myMethod(int a); +} + +struct MyType : MyInterface +{ + int myMethod(int a) + { + return a * 3; + } +} + +int genericFunc<T: MyInterface>(T arg) +{ + return arg.myMethod(3); +} + +public int normalFuncUsesGeneric(int a) +{ + MyType obj; + return genericFunc(obj); +} + +public int normalFunc(int a) +{ + return a - 2; +} |
