blob: 4031a09fb2328eda2565b5b0fcd4543a5ef8681f [file] [log] [blame]
Andrew Lenharthe2339af2006-06-28 20:07:36 +00001; FIXME: this should be SHM for bu, but change it for now since besides incompleteness
2; this is working
Reid Spencerfd90dd52006-08-18 06:34:30 +00003; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=Y:SHIM && \
4; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=P1:SHM,P2:SHM
Chris Lattner73f1ac42005-03-21 20:18:51 +00005
6%G = internal constant [2 x int*(int*)*] [
7 int*(int*)* %callee1, int*(int*)* %callee2
8]
9
10implementation
11
12internal int* %callee1(int* %P1) {
13 ret int* %P1
14}
15
16internal int* %callee2(int* %P2) {
17 %X = malloc int
18 ret int* %X
19}
20
21void %caller(int %callee) {
22 %FPP = getelementptr [2 x int*(int*)*]* %G, int 0, int %callee
23 %FP = load int*(int*)** %FPP
24
25 %Y = alloca int
26 %Z = call int* %FP(int* %Y)
27 store int 4, int* %Z
28 ret void
29}