-
Notifications
You must be signed in to change notification settings - Fork 126
Open
Description
source code helloworld.c
#include<stdio.h>
int main(){
printf("helloworld!");
return 0;
}
compile command gcc helloworld.c
execute command llvm-mctoll -d a.out -I /usr/include/stdio.h
generated a.out-dis.ll
execute command cat a.out-dis.ll
output
ModuleID = 'a.out'
source_filename = "a.out"
@rodata_18 = private unnamed_addr constant [16 x i8] c"\01\00\02\00helloworld!\00", align 4, !ROData_SecInfo !0
declare dso_local i32 @printf(ptr, ...)
define dso_local i32 @main() {
entry:
%RSP_P.0 = alloca i64, align 1
store i64 3735928559, ptr %RSP_P.0, align 8
%RBP = ptrtoint ptr %RSP_P.0 to i64
%EAX = call i32 (ptr, ...) @printf(ptr getelementptr inbounds ([16 x i8], ptr @rodata_18, i32 0, i32 4))
ret i32 0
}
!0 = !{i64 8192}
execute command llvm-as a.out-dis.ll -o a.out-dis.bc
errors
error: '@rodata_18' defined with type '[16 x i8]*' but expected 'i8*'
%EAX = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], i8* @rodata_18, i32 0, i32 4))
a.out-dis.ll:6:31: error: expected type
declare dso_local i32 @printf(ptr, ...)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels