summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cpu-program/class.slang23
-rw-r--r--tests/cpu-program/class.slang.expected6
-rw-r--r--tests/diagnostics/class-keyword.slang2
-rw-r--r--tests/disabled-tests.txt6
4 files changed, 36 insertions, 1 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
+}
diff --git a/tests/diagnostics/class-keyword.slang b/tests/diagnostics/class-keyword.slang
index c0495a614..c869496b9 100644
--- a/tests/diagnostics/class-keyword.slang
+++ b/tests/diagnostics/class-keyword.slang
@@ -1,4 +1,4 @@
-//DIAGNOSTIC_TEST:SIMPLE:
+//DISABLED_TEST:DIAGNOSTIC_TEST:SIMPLE:
// `class` keyword is a reserved keyword in this context, and wso should produce an error.
// It can be used in the form of `enum class`
diff --git a/tests/disabled-tests.txt b/tests/disabled-tests.txt
index e588c153d..2fc5867b4 100644
--- a/tests/disabled-tests.txt
+++ b/tests/disabled-tests.txt
@@ -49,6 +49,12 @@ These tests are disabled due to other limitations of gfx layer.
* compute/half-rw-texture-convert.slang
* compute/half-rw-texture-simple.slang
+### Temporary Language Limitation
+
+This test is disabled due to temporary compiler implementation limitations.
+Should re-enable once the new checks for `class` usage is complete.
+
+* diagnostics/class-keyword.slang
### Uncategorized