diff options
| author | Yong He <yonghe@outlook.com> | 2024-05-29 18:01:11 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-29 18:01:11 -0700 |
| commit | efdbb954c57b89362e390f955d45f90e59d66878 (patch) | |
| tree | 7b47d6e52d2de666af99f66a2fd3a5dc387ca5cc /tests/language-feature/extensions | |
| parent | 83f176ba8a3bae5533470aed6a90663653f894b8 (diff) | |
Improve compile time performance. (#3857)
* Handle type check cache update on extensions more gracefully.
* Correctness fix.
* Cache implcit cast overload resolution results.
* Fix.
* More optimizations.
* Cache implicit default ctor resolution.
* Disable redundancy removal.
* Fix.
* Fix test.
* Fix.
* Correctness fix.
* Fix.
* Fix,
* Fix test.
* Small tweak.
Diffstat (limited to 'tests/language-feature/extensions')
| -rw-r--r-- | tests/language-feature/extensions/extension-method-simple.slang | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/language-feature/extensions/extension-method-simple.slang b/tests/language-feature/extensions/extension-method-simple.slang new file mode 100644 index 000000000..d3162c053 --- /dev/null +++ b/tests/language-feature/extensions/extension-method-simple.slang @@ -0,0 +1,30 @@ +// interface-extension.slang + +// Test that an `extension` applied to an interface type works as users expect + +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj + +struct MyType +{ + int v; +} + +extension MyType +{ + int foo() + { + return v; + } +} + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<int> outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) +{ + MyType t; + t.v = 1; + // CHECK: 1 + outputBuffer[dispatchThreadID.x] = t.foo(); +} |
