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