1 ; RUN: llc < %s | grep caml.*__frametable
2 ; RUN: llc < %s -march=x86 | grep {movl .0}
4 %struct.obj = type { i8*, %struct.obj* }
6 define %struct.obj* @fun(%struct.obj* %head) gc "ocaml" {
11 call void @llvm.gcroot(i8** %gcroot.0, i8* null)
12 call void @llvm.gcroot(i8** %gcroot.1, i8* null)
14 %local.0 = bitcast i8** %gcroot.0 to %struct.obj**
15 %local.1 = bitcast i8** %gcroot.1 to %struct.obj**
17 store %struct.obj* %head, %struct.obj** %local.0
20 %t0 = load %struct.obj** %local.0
21 %t1 = getelementptr %struct.obj* %t0, i32 0, i32 1
22 %t2 = bitcast %struct.obj* %t0 to i8*
23 %t3 = bitcast %struct.obj** %t1 to i8**
24 %t4 = call i8* @llvm.gcread(i8* %t2, i8** %t3)
25 %t5 = bitcast i8* %t4 to %struct.obj*
26 %t6 = icmp eq %struct.obj* %t5, null
27 br i1 %t6, label %bb.loop, label %bb.end
29 %t7 = malloc %struct.obj
30 store %struct.obj* %t7, %struct.obj** %local.1
31 %t8 = bitcast %struct.obj* %t7 to i8*
32 %t9 = load %struct.obj** %local.0
33 %t10 = getelementptr %struct.obj* %t9, i32 0, i32 1
34 %t11 = bitcast %struct.obj* %t9 to i8*
35 %t12 = bitcast %struct.obj** %t10 to i8**
36 call void @llvm.gcwrite(i8* %t8, i8* %t11, i8** %t12)
40 declare void @llvm.gcroot(i8** %value, i8* %tag)
41 declare void @llvm.gcwrite(i8* %value, i8* %obj, i8** %field)
42 declare i8* @llvm.gcread(i8* %obj, i8** %field)