Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,6 @@
$ make
llvm-as scriptname.ll
llc -disable-cfi scriptname.bc
gcc -o scriptname scriptname.s
./scriptname
Program: ./scriptname

View file

@ -0,0 +1,10 @@
all: scriptname.ll
llvm-as scriptname.ll
llc scriptname.bc
gcc -o scriptname scriptname.s
./scriptname
clean:
-rm scriptname
-rm scriptname.s
-rm scriptname.bc

View file

@ -0,0 +1,10 @@
@msg_main = internal constant [13 x i8] c"Program: %s\0A\00"
declare i32 @printf(i8* noalias nocapture, ...)
define i32 @main(i32 %argc, i8** %argv) {
%program = load i8** %argv
call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([13 x i8]* @msg_main, i32 0, i32 0), i8* %program)
ret i32 0
}