From 92dfec2320421113498ae7b5b72e78bd8b5b09a8 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 21 Jun 2022 09:25:51 -0700 Subject: Add CPU executable compile test (#2278) * Add cpu executable compile test * Fix. * Fix permission on linux * retrigger build Co-authored-by: Yong He --- tests/cpu-program/cpu-hello-world.slang | 9 +++++++++ tests/cpu-program/cpu-hello-world.slang.expected | 6 ++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/cpu-program/cpu-hello-world.slang create mode 100644 tests/cpu-program/cpu-hello-world.slang.expected (limited to 'tests/cpu-program') 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. +} -- cgit v1.2.3