2002-10-31 05:38:19 +00:00
|
|
|
; This testcase is used to make sure that the outer element of arrays are
|
|
|
|
; folded completely away if possible. This is a very common case, so it should
|
|
|
|
; be efficient.
|
|
|
|
;
|
2006-08-27 22:41:58 +00:00
|
|
|
; RUN: llvm-as < %s | opt -analyze -tddatastructure
|
2003-10-03 18:42:25 +00:00
|
|
|
;
|
2002-10-31 05:38:19 +00:00
|
|
|
implementation
|
|
|
|
|
|
|
|
sbyte* %merge1([100 x sbyte] *%A, long %N) {
|
|
|
|
%P = getelementptr [100 x sbyte] *%A, long 0, long %N
|
|
|
|
ret sbyte* %P
|
|
|
|
}
|
|
|
|
|
|
|
|
sbyte* %merge2([100 x sbyte] *%A, long %N) {
|
|
|
|
; The graph for this example should end up exactly the same as for merge1
|
|
|
|
%P1 = getelementptr [100 x sbyte] *%A, long 0, long 0
|
|
|
|
%P2 = getelementptr sbyte* %P1, long %N
|
|
|
|
ret sbyte* %P2
|
|
|
|
}
|
|
|
|
|