blob: 76c226570f5650d974d664e5d0a4bba81564fba8 [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
3; RUN: analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=Y:SHIM && \
Chris Lattner73f1ac42005-03-21 20:18:51 +00004; RUN: analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=P1:SHM,P2:SHM
5
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}