aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/compiler_output.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compiler_output.sh')
-rw-r--r--tests/compiler_output.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/compiler_output.sh b/tests/compiler_output.sh
new file mode 100644
index 0000000..6993c36
--- /dev/null
+++ b/tests/compiler_output.sh
@@ -0,0 +1,17 @@
+cat > foo.c <<'EOF'
+int main() {}
+EOF
+
+"$ducc" -o bar.s foo.c
+if [[ $? -ne 0 ]]; then
+ exit 1
+fi
+gcc -o a.out bar.s
+./a.out "$@"
+exit_code=$?
+
+if [[ $exit_code -ne 0 ]]; then
+ echo "invalid exit code: $exit_code" >&2
+ exit 1
+fi
+