diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-31 04:48:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-31 04:48:32 +0000 |
commit | 2230b412f73d106a84277f7462cd14380485b63e (patch) | |
tree | 6abd38180a657f3d7cd662d73a01d236ee74bb33 /test | |
parent | 6b1c4fcfb5e0c8843054dfc8de62888927fa6ce9 (diff) | |
download | external_llvm-2230b412f73d106a84277f7462cd14380485b63e.zip external_llvm-2230b412f73d106a84277f7462cd14380485b63e.tar.gz external_llvm-2230b412f73d106a84277f7462cd14380485b63e.tar.bz2 |
New testcase for the possible array merging scenarios
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/DSAnalysis/arraytest.ll | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/Transforms/DSAnalysis/arraytest.ll b/test/Transforms/DSAnalysis/arraytest.ll new file mode 100644 index 0000000..164eb74 --- /dev/null +++ b/test/Transforms/DSAnalysis/arraytest.ll @@ -0,0 +1,38 @@ + +%crazy = type [2 x { [2 x sbyte], short } ] + +implementation + +sbyte *%test1(%crazy* %P1) { ; No merging, constant indexing + %P = getelementptr %crazy* %P1, long 0, long 0, ubyte 0, long 1 + ret sbyte *%P +} + +sbyte *%test2(%crazy* %P1) { ; No merging, constant indexing + %P = getelementptr %crazy* %P1, long 0, long 1, ubyte 0, long 0 + ret sbyte *%P +} + +sbyte *%test3(%crazy* %P1) { ; No merging, constant indexing, must handle outter index + %P = getelementptr %crazy* %P1, long -1, long 0, ubyte 0, long 0 + ret sbyte *%P +} + +sbyte *%mtest1(%crazy* %P1, long %idx) { ; Merging deepest array + %P = getelementptr %crazy* %P1, long 0, long 0, ubyte 0, long %idx + ret sbyte *%P +} +sbyte *%mtest2(%crazy* %P1, long %idx) { ; Merge top array + %P = getelementptr %crazy* %P1, long 0, long %idx, ubyte 0, long 1 + ret sbyte *%P +} +sbyte *%mtest3(%crazy* %P1, long %idx) { ; Merge array %crazy is in + %P = getelementptr %crazy* %P1, long %idx, long 0, ubyte 0, long 1 + ret sbyte *%P +} + +sbyte *%m2test1(%crazy* %P1, long %idx) { ; Merge two arrays + %P = getelementptr %crazy* %P1, long 0, long %idx, ubyte 0, long %idx + ret sbyte *%P +} + |