Skip to content

Instantly share code, notes, and snippets.

@tomaka
Created February 16, 2016 09:09
Show Gist options
  • Select an option

  • Save tomaka/bb2a7814f877abeb1fcd to your computer and use it in GitHub Desktop.

Select an option

Save tomaka/bb2a7814f877abeb1fcd to your computer and use it in GitHub Desktop.
; ModuleID = 'test.0.rs'
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
target triple = "asmjs-unknown-emscripten"
@_ZN5hello4DATA20hc62f1ab83f6c61e4GaaE = internal constant [5 x i8] c"\01\02\03\04\05", align 1
; Function Attrs: noinline norecurse nounwind readnone uwtable
define { i8*, i32 } @_ZN3get20h14b169bb767a00d2naaE(i8* noalias nonnull readonly, i32) unnamed_addr #0 {
entry-block:
%2 = insertvalue { i8*, i32 } undef, i8* %0, 0
%3 = insertvalue { i8*, i32 } %2, i32 %1, 1
ret { i8*, i32 } %3
}
; Function Attrs: noinline norecurse nounwind readnone uwtable
define i32 @_ZN5hello20h8f08c4dab1248153BaaE() unnamed_addr #0 {
entry-block:
%0 = tail call { i8*, i32 } @_ZN3get20h14b169bb767a00d2naaE(i8* noalias nonnull readonly getelementptr inbounds ([5 x i8], [5 x i8]* @_ZN5hello4DATA20hc62f1ab83f6c61e4GaaE, i32 0, i32 0), i32 5)
%1 = extractvalue { i8*, i32 } %0, 1
ret i32 %1
}
attributes #0 = { noinline norecurse nounwind readnone uwtable }
; ModuleID = 'test.0.rs'
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
target triple = "asmjs-unknown-emscripten"
@byte_str3170 = internal unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nounwind
declare void @printf(i8* nocapture readonly, ...) unnamed_addr #0
; Function Attrs: nounwind
define i32 @main(i32, i8** nocapture readnone) unnamed_addr #0 {
top:
tail call void (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @byte_str3170, i32 0, i32 0), i32 5) #0
ret i32 0
}
attributes #0 = { nounwind }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment