Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Analysis / Andersens / external.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -anders-aa -load-vn -gcse -deadargelim | llvm-dis | grep store | not grep null
2
3 ; Because the 'internal' function is passed to an external function, we don't
4 ; know what the incoming values will alias.  As such, we cannot do the 
5 ; optimization checked by the 'arg-must-alias.llx' test.
6
7 declare void %external(int(int*)*)
8 %G = internal constant int* null
9
10 implementation
11
12 internal int %internal(int* %ARG) {
13         ;;; We *DON'T* know that ARG always points to null!
14         store int* %ARG, int** %G
15         ret int 0
16 }
17
18 int %foo() {
19         call void %external(int(int*)* %internal)
20         %V = call int %internal(int* null)
21         ret int %V
22 }