Update IR test for modern language and toolchain
This commit is contained in:
parent
91db46aaec
commit
70fd9d8563
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/ir-test/ir-test
|
@ -3,11 +3,11 @@ PROG := ir-test
|
|||||||
|
|
||||||
all: clean $(PROG)
|
all: clean $(PROG)
|
||||||
|
|
||||||
$(PROG): $(PROG).bc
|
$(PROG): $(PROG).o
|
||||||
llvm-ld -o $@ -native $<
|
gcc -o $@ $<
|
||||||
|
|
||||||
%.bc: %.ll
|
%.o: %.ll
|
||||||
llvm-as $<
|
clang -c -o $@ $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *~ *.bc $(PROG)
|
rm -f *~ *.o $(PROG)
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
|
|
||||||
@str = internal constant [12 x i8] c"hello world\00"
|
@str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
|
||||||
|
|
||||||
declare i32 @puts(i8 *)
|
declare i32 @puts(ptr nocapture) nounwind
|
||||||
|
|
||||||
define i32 @main() {
|
define i32 @main() {
|
||||||
%cast210 = getelementptr [12 x i8]* @str, i64 0, i64 0
|
call i32 @puts(ptr @str)
|
||||||
|
|
||||||
call i32 @puts(i8 * %cast210)
|
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user