Created
March 10, 2020 08:46
-
-
Save kateinoigakukun/ff6f717c3e939777ed2c787a6422498d to your computer and use it in GitHub Desktop.
This file contains 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
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" | |
target triple = "wasm32-unknown-wasi" | |
define swiftcc void @foo(i32, i32) { | |
ret void | |
} | |
@data = global i8* bitcast (void (i32, i32)* @foo to i8*) | |
define swiftcc void @bar(i8* %input) { | |
%1 = load i8*, i8** @data | |
%2 = bitcast i8* %1 to void (i32, i32, i32)* | |
call swiftcc void %2(i32 1, i32 2, i32 swiftself 1) | |
ret void | |
} | |
define void @_start() { | |
call swiftcc void @bar(i8* null) | |
ret void | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment