added ir-test directory
git-svn-id: svn://anubis/misc/llvm@62 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
parent
1b1766e07b
commit
d1fb787959
13
ir-test/Makefile
Normal file
13
ir-test/Makefile
Normal 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
11
ir-test/ir-test.ll
Normal 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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user