added ir-test directory

git-svn-id: svn://anubis/misc/llvm@62 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
josh 2008-11-01 03:27:01 +00:00
parent 1b1766e07b
commit d1fb787959
2 changed files with 24 additions and 0 deletions

13
ir-test/Makefile Normal file
View File

@ -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)

11
ir-test/ir-test.ll Normal file
View File

@ -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
}