aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test_compiler_output.sh
blob: 6993c36298f8b443354bdf70ef506e0d03258b07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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