standalone: Fix run_demo script

- Link main and module*.bc together if using multiple threads
- Fix temporary files not being deleted
David Mak 2023-10-16 13:44:29 +08:00
parent d7dfab863a
commit d806ad841c
1 changed files with 3 additions and 5 deletions

View File

@ -48,11 +48,9 @@ else
clang -c -std=gnu11 -Wall -Wextra -O3 -emit-llvm -o demo.bc demo.c
if ls module*.bc >/dev/null 2>&1; then
llvm-link -o module.bc module*.bc main.bc
else
llvm-link -o module.bc main.bc
fi
shopt -s nullglob
llvm-link -o module.bc module*.bc main.bc
shopt -u nullglob
if [ -z "$outfile" ]; then
lli --extra-module demo.bc --extra-module irrt.bc module.bc