New testcase to see if -indvars can promote pointer arithmetic to array accesses
[oota-llvm.git] / test / Transforms / DSAnalysis / badcases.ll
1 ; This file contains a list of situations where node folding should happen...
2 ;
3 ; RUN: analyze %s -tddatastructure
4
5 implementation
6
7 void %test1({int, int} * %X) {
8         getelementptr {int, int} * %X, long 0
9         %Y = cast {int, int} * %X to sbyte*
10         %Z = getelementptr sbyte* %Y, long 7
11         store sbyte 6, sbyte *%Z
12         ret void
13 }
14
15 void %test2({int, int} * %X) {
16         getelementptr {int, int} * %X, long 0
17         %Y = cast {int, int} * %X to {sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte} *
18         %Z = getelementptr {sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte}* %Y, long 0, ubyte 7
19         store sbyte 6, sbyte *%Z
20         ret void
21 }
22