Chris Lattner | 73f1ac4 | 2005-03-21 20:18:51 +0000 | [diff] [blame] | 1 | ; 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 | |
| 8 | implementation |
| 9 | |
| 10 | internal int* %callee1(int* %P1) { |
| 11 | ret int* %P1 |
| 12 | } |
| 13 | |
| 14 | internal int* %callee2(int* %P2) { |
| 15 | %X = malloc int |
| 16 | ret int* %X |
| 17 | } |
| 18 | |
| 19 | void %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 | } |