summaryrefslogtreecommitdiffstats
path: root/tests/cpu-program
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cpu-program')
-rw-r--r--tests/cpu-program/cpu-hello-world.slang9
-rw-r--r--tests/cpu-program/cpu-hello-world.slang.expected6
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/cpu-program/cpu-hello-world.slang b/tests/cpu-program/cpu-hello-world.slang
new file mode 100644
index 000000000..9385b239c
--- /dev/null
+++ b/tests/cpu-program/cpu-hello-world.slang
@@ -0,0 +1,9 @@
+//TEST:EXECUTABLE:
+__target_intrinsic(cpp, "printf(\"%s\\n\", ($0).getBuffer())")
+void writeln(String text);
+
+public __extern_cpp int main()
+{
+ writeln("Hello World.");
+ return 0;
+} \ No newline at end of file
diff --git a/tests/cpu-program/cpu-hello-world.slang.expected b/tests/cpu-program/cpu-hello-world.slang.expected
new file mode 100644
index 000000000..81531657f
--- /dev/null
+++ b/tests/cpu-program/cpu-hello-world.slang.expected
@@ -0,0 +1,6 @@
+result code = 0
+standard error = {
+}
+standard output = {
+Hello World.
+}