-
-
Save vihanb/7c6d46ed3b81b1b276cec39e328671eb to your computer and use it in GitHub Desktop.
VSL Goat Test
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
; ModuleID = 'main' | |
source_filename = "main" | |
%"String.$12" = type { i32, i8* } | |
%"Goat.$53" = type { %"String.$12"* } | |
@0 = private unnamed_addr constant [4 x i8] c"foo\00" | |
@1 = private unnamed_addr constant %"String.$12" { i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0) } | |
define i32 @main(i32, i8**) { | |
entry: | |
%2 = call i8* @malloc(i64 8) | |
%3 = bitcast i8* %2 to %"Goat.$53"* | |
%4 = call %"Goat.$53"* @"Goat.init$54"(%"Goat.$53"* %3) | |
%5 = getelementptr inbounds %"Goat.$53", %"Goat.$53"* %4, i32 0, i32 0 | |
%6 = load %"String.$12"*, %"String.$12"** %5 | |
call void @"print.$32"(%"String.$12"* %6) | |
ret i32 0 | |
} | |
; Function Attrs: inlinehint norecurse | |
define %"Goat.$53"* @"Goat.init$54"(%"Goat.$53"*) #0 { | |
entry: | |
%1 = getelementptr inbounds %"Goat.$53", %"Goat.$53"* %0, i32 0, i32 0 | |
store %"String.$12"* @1, %"String.$12"** %1 | |
ret %"Goat.$53"* %0 | |
} | |
declare i8* @malloc(i64) | |
define void @"print.$32"(%"String.$12"*) { | |
entry: | |
%1 = getelementptr inbounds %"String.$12", %"String.$12"* %0, i32 0, i32 1 | |
%2 = load i8*, i8** %1 | |
%3 = call i32 @puts(i8* %2) | |
ret void | |
} | |
declare i32 @puts(i8*) | |
attributes #0 = { inlinehint norecurse } |
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
class Goat { | |
let a = "foo" | |
} | |
public func main() { | |
let name = Goat() | |
print(name.a) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment