diff options
author | Chris Lattner <sabre@nondot.org> | 2002-08-16 21:18:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-08-16 21:18:21 +0000 |
commit | edf6a84a75ffcae567f1242de44423964b5653d4 (patch) | |
tree | 0c71409dc532216c0f644a3799c23c01c7c41cba | |
parent | 1c93e5bd26cf1b41ed7bdf5561b8f20607488b0f (diff) |
Add new testcase for gep instruction -> get constexpr promotion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3364 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Transforms/InstCombine/getelementptr.ll | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/getelementptr.ll b/test/Transforms/InstCombine/getelementptr.ll index 1579509372..2a482ed0a3 100644 --- a/test/Transforms/InstCombine/getelementptr.ll +++ b/test/Transforms/InstCombine/getelementptr.ll @@ -5,6 +5,8 @@ ; RUN: else exit 0 ; RUN: fi +%Global = constant [10 x sbyte] c"helloworld" + implementation int *"foo1"(int * %I) { ; Test noop elimination @@ -27,3 +29,9 @@ int* %foo4({int} *%I) { ; Test that two getelementptr insts fold %B = getelementptr {int}* %A, uint 0, ubyte 0 ret int* %B } + +sbyte * %foo5() { + ; This should be turned into a constexpr instead of being an instruction + %A = getelementptr [10 x sbyte]* %Global, uint 0, uint 4 + ret sbyte* %A +} |