9c1bf8bed9545950fb94cc4cc92d72347f7d446b
[oota-llvm.git] / test / ExecutionEngine / OrcLazy / hello.ll
1 ; RUN: lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stderr %s 2>&1 | FileCheck %s
2 ;
3 ; CHECK: Hello
4 ; CHECK: [ main$orc_body ]
5 ; CHECK: Goodbye
6
7 %class.Foo = type { i8 }
8 %struct.__sFILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
9 %struct.__sFILEX = type opaque
10 %struct.__sbuf = type { i8*, i32 }
11
12 @f = global %class.Foo zeroinitializer, align 1
13 @__dso_handle = external global i8
14 @__stderrp = external global %struct.__sFILE*
15 @.str = private unnamed_addr constant [7 x i8] c"Hello\0A\00", align 1
16 @.str1 = private unnamed_addr constant [9 x i8] c"Goodbye\0A\00", align 1
17 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_hello.cpp, i8* null }]
18
19 define internal void @_GLOBAL__sub_I_hello.cpp() section "__TEXT,__StaticInit,regular,pure_instructions" {
20 entry:
21   call void @_ZN3FooC1Ev(%class.Foo* @f)
22   %0 = call i32 @__cxa_atexit(void (i8*)* bitcast (void (%class.Foo*)* @_ZN3FooD1Ev to void (i8*)*), i8* getelementptr inbounds (%class.Foo, %class.Foo* @f, i32 0, i32 0), i8* @__dso_handle)
23   ret void
24 }
25
26 define linkonce_odr void @_ZN3FooC1Ev(%class.Foo* %this) unnamed_addr align 2 {
27 entry:
28   %0 = load %struct.__sFILE*, %struct.__sFILE** @__stderrp, align 8
29   %call.i = call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0))
30   ret void
31 }
32
33 define linkonce_odr void @_ZN3FooD1Ev(%class.Foo* %this) unnamed_addr align 2 {
34 entry:
35   %0 = load %struct.__sFILE*, %struct.__sFILE** @__stderrp, align 8
36   %call.i = call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str1, i32 0, i32 0))
37   ret void
38 }
39
40
41 define i32 @main(i32 %argc, i8** %argv) {
42 entry:
43   ret i32 0
44 }
45
46 declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*)
47 declare i32 @fprintf(%struct.__sFILE*, i8*, ...)