summaryrefslogtreecommitdiff
path: root/old/llvmtests/README
diff options
context:
space:
mode:
Diffstat (limited to 'old/llvmtests/README')
-rw-r--r--old/llvmtests/README30
1 files changed, 25 insertions, 5 deletions
diff --git a/old/llvmtests/README b/old/llvmtests/README
index 8de04b8..6755a79 100644
--- a/old/llvmtests/README
+++ b/old/llvmtests/README
@@ -1,5 +1,25 @@
-clang -o hello.l -I../../include/wolf -Os -S -emit-llvm hello.c
-opt -S hello.s > hello-opt.s
-xxdiff hello.s hello-opt.s
-llc -O0 hello.l -march=x86-64 -p hello-amd64.s
-llc -O0 hello.l -march=mipsel -o hello-mipsel.s
+# generate LLVM IR
+clang -o hello.l -O0 -S -emit-llvm hello.c
+clang --target=x86_64-pc-linux-gnu -o hello-x86_64.l -O0 -S -emit-llvm hello.c
+clang --target=i386-pc-linux-gnu -o hello-i386.l -O0 -S -emit-llvm hello.c
+clang --target=aarch64-unknown-linux-gui -o hello-aarch64.l -O0 -S -emit-llvm hello.c
+
+# optimize and compare
+opt -S hello.l > hello-opt.l
+xxdiff hello.l hello-opt.l
+
+# run LLVM code in interpreter
+lli hello.l
+
+# generate native assembler
+llc -O0 hello.l -o hello.s
+llc -O0 hello-x86_64.l -march=x86-64 -o hello-amd64.s
+llc -O0 hello-i386.l -march=i386 -o hello-i386.s
+llc -O0 hello-aarch64.l -march=aarch64 -o hello-aarch64.s
+
+# cross toolchains needed for i386 and aarch64
+as -o hello.o hello.s
+gcc -o hello hello.o
+
+# TBD
+gcc -fverbose-asm -Os -S -o hello.s hello.c