blob: 5697ceea8cb036f4f61877a0013a8b5b9b7f9daf [file] [log] [blame]
Chris Lattner73f1ac42005-03-21 20:18:51 +00001; RUN: analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=Y:SHM && \
2; RUN: analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=P1:SHM,P2:SHM
3
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}