diff options
| author | Yong He <yonghe@outlook.com> | 2022-07-12 22:45:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-12 22:45:05 -0700 |
| commit | 049aac1b80143753b4b3449e529024bafe2250be (patch) | |
| tree | e6734ef240bf7016562a301009add1761caf06f6 /tests/cpu-program | |
| parent | a6775666c38ccaeb2a991921a08343afa09c659b (diff) | |
Support `class` types. (#2321)
* Support `class` types.
* Ignore class-keyword test
* Fix codereview comments and warnings.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/cpu-program')
| -rw-r--r-- | tests/cpu-program/class.slang | 23 | ||||
| -rw-r--r-- | tests/cpu-program/class.slang.expected | 6 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/cpu-program/class.slang b/tests/cpu-program/class.slang new file mode 100644 index 000000000..1fc35aed0 --- /dev/null +++ b/tests/cpu-program/class.slang @@ -0,0 +1,23 @@ +//TEST:EXECUTABLE: +__target_intrinsic(cpp, "printf(\"%s\\n\", ($0).getBuffer())") +void writeln(String text); + +class MyClass +{ + int intMember; + __init() + { + intMember = 0; + } + int method() + { + writeln("method"); + return intMember; + } +} + +public __extern_cpp int main() +{ + MyClass obj = new MyClass(); + return obj.method(); +}
\ No newline at end of file diff --git a/tests/cpu-program/class.slang.expected b/tests/cpu-program/class.slang.expected new file mode 100644 index 000000000..70274e060 --- /dev/null +++ b/tests/cpu-program/class.slang.expected @@ -0,0 +1,6 @@ +result code = 0 +standard error = { +} +standard output = { +method +} |
