diff --git a/ir-test/Makefile b/ir-test/Makefile new file mode 100644 index 0000000..65b3382 --- /dev/null +++ b/ir-test/Makefile @@ -0,0 +1,13 @@ + +PROG := ir-test + +all: clean $(PROG) + +$(PROG): $(PROG).bc + llvm-ld -o $@ -native $< + +%.bc: %.ll + llvm-as $< + +clean: + rm -f *~ *.bc $(PROG) diff --git a/ir-test/ir-test.ll b/ir-test/ir-test.ll new file mode 100644 index 0000000..7a83d65 --- /dev/null +++ b/ir-test/ir-test.ll @@ -0,0 +1,11 @@ + +@str = internal constant [12 x i8] c"hello world\00" + +declare i32 @puts(i8 *) + +define i32 @main() { + %cast210 = getelementptr [12 x i8]* @str, i64 0, i64 0 + + call i32 @puts(i8 * %cast210) + ret i32 0 +}