From d1fb7879597eb49e82b53194446951c866edd616 Mon Sep 17 00:00:00 2001 From: josh Date: Sat, 1 Nov 2008 03:27:01 +0000 Subject: [PATCH] added ir-test directory git-svn-id: svn://anubis/misc/llvm@62 bd8a9e45-a331-0410-811e-c64571078777 --- ir-test/Makefile | 13 +++++++++++++ ir-test/ir-test.ll | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ir-test/Makefile create mode 100644 ir-test/ir-test.ll 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 +}