diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-06 06:20:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-06 06:20:53 +0000 |
commit | a434ae74e76ea4ef69c680156bdb36779babf105 (patch) | |
tree | c5b2b132a8a2477fd2ee8a02f28c508349577d96 | |
parent | 08db719c4b1134746da5d03b22f0da4050c91f99 (diff) |
New testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4563 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Transforms/DSAnalysis/badcases.ll | 20 | ||||
-rw-r--r-- | test/Transforms/DSAnalysis/goodcases.ll | 21 |
2 files changed, 41 insertions, 0 deletions
diff --git a/test/Transforms/DSAnalysis/badcases.ll b/test/Transforms/DSAnalysis/badcases.ll new file mode 100644 index 0000000000..16284529dc --- /dev/null +++ b/test/Transforms/DSAnalysis/badcases.ll @@ -0,0 +1,20 @@ +; This file contains a list of situations where node folding should happen... + +implementation + +void %test1({int, int} * %X) { + getelementptr {int, int} * %X, long 0 + %Y = cast {int, int} * %X to sbyte* + %Z = getelementptr sbyte* %Y, long 7 + store sbyte 6, sbyte *%Z + ret void +} + +void %test2({int, int} * %X) { + getelementptr {int, int} * %X, long 0 + %Y = cast {int, int} * %X to {sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte} * + %Z = getelementptr {sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte}* %Y, long 0, ubyte 7 + store sbyte 6, sbyte *%Z + ret void +} + diff --git a/test/Transforms/DSAnalysis/goodcases.ll b/test/Transforms/DSAnalysis/goodcases.ll new file mode 100644 index 0000000000..6d1fe629dc --- /dev/null +++ b/test/Transforms/DSAnalysis/goodcases.ll @@ -0,0 +1,21 @@ +; This file contains a list of cases where node folding should NOT happen +; + +implementation + +void %test1({int, int}* %X) { + getelementptr {int, int} * %X, long 0 + %Y = cast {int, int}* %X to uint* + store uint 5, uint* %Y + ret void +} + +; Test that "structural" equality works. Pointers can land in pointers n +; stuff. +void %test2({int*, int*}* %X) { + getelementptr {int*, int*}* %X, long 0 + %Y = cast {int*, int*}* %X to {uint*, long*}* + getelementptr {uint*, long*}* %Y, long 0 + ret void +} + |