Created
May 24, 2012 08:43
-
-
Save fjolnir/2780255 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@hello = internal constant [21 x i8] c"hello, world %d - %f\00" | |
declare float @llvm.cos.f32(float %Val) | |
declare i32 @printf(i8* noalias nocapture, ...) nounwind | |
define fastcc i32 @main(i32 %argc, i8** %argv) nounwind { | |
start: | |
; Cast i8 array to pointer | |
%ptr = getelementptr [21 x i8]* @hello, i64 0, i64 0 | |
%cos = call float @llvm.cos.f32(float 3.0) | |
call i32 (i8*, ...)* @printf(i8* %ptr, i32 %argc, float %cos) | |
tail call fastcc i32 @main(i32 0, i8** null) | |
ret i32 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment