Skip to content

Instantly share code, notes, and snippets.

@vihanb
Created March 30, 2018 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vihanb/7a987045a89a67db3095093a360acee9 to your computer and use it in GitHub Desktop.
Save vihanb/7a987045a89a67db3095093a360acee9 to your computer and use it in GitHub Desktop.
; ModuleID = '<stdin>'
source_filename = "main"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin17.2.0"
%0 = type { i32, void ()*, i8* }
%TCString = type { i32, i8* }
@0 = private unnamed_addr constant [14 x i8] c"Hello, World!\00"
@llvm.global_ctors = appending global [1 x %0] zeroinitializer
; Function Attrs: nounwind
define i32 @main(i32, i8** nocapture readnone) local_unnamed_addr #0 {
entry:
%2 = tail call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @0, i64 0, i64 0)) #0
ret i32 0
}
; Function Attrs: nounwind
define void @FgNprintAstringTCString(%TCString* nocapture readonly) local_unnamed_addr #0 {
entry:
%1 = getelementptr inbounds %TCString, %TCString* %0, i64 0, i32 1
%2 = load i8*, i8** %1, align 8
%3 = tail call i32 @puts(i8* %2)
ret void
}
; Function Attrs: nounwind
declare i32 @puts(i8* nocapture readonly) local_unnamed_addr #0
attributes #0 = { nounwind }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment