blob: 9c904fa0e07e115d0f37684645ed7011c6bd00e7 [file] [log] [blame]
Andrew Lenharth21c04a32006-10-23 19:52:27 +00001; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=Y:SHM && \
Chris Lattnerd52e1b02006-08-27 22:47:14 +00002; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=P1:SHM,P2:SHM
Chris Lattner73f1ac42005-03-21 20:18:51 +00003
4%G = internal constant [2 x int*(int*)*] [
5 int*(int*)* %callee1, int*(int*)* %callee2
6]
7
8implementation
9
10internal int* %callee1(int* %P1) {
11 ret int* %P1
12}
13
14internal int* %callee2(int* %P2) {
15 %X = malloc int
16 ret int* %X
17}
18
19void %caller(int %callee) {
20 %FPP = getelementptr [2 x int*(int*)*]* %G, int 0, int %callee
21 %FP = load int*(int*)** %FPP
22
23 %Y = alloca int
24 %Z = call int* %FP(int* %Y)
25 store int 4, int* %Z
26 ret void
27}