diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-14 04:58:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-14 04:58:40 +0000 |
commit | 6c84e795ea968d7ece231367cb8e5535429199d5 (patch) | |
tree | 7f58952f4cdba840b8aa3b6511b74842a8f017e3 /test | |
parent | b31a828533c954d9f5298509e39d8c884c7cabf5 (diff) | |
download | external_llvm-6c84e795ea968d7ece231367cb8e5535429199d5.zip external_llvm-6c84e795ea968d7ece231367cb8e5535429199d5.tar.gz external_llvm-6c84e795ea968d7ece231367cb8e5535429199d5.tar.bz2 |
New testcase, SROA with variable array index
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/ScalarRepl/sroa_two.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/ScalarRepl/sroa_two.ll b/test/Transforms/ScalarRepl/sroa_two.ll new file mode 100644 index 0000000..2d8e7c6 --- /dev/null +++ b/test/Transforms/ScalarRepl/sroa_two.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis + +implementation + +int %test(int %X) { + %Arr = alloca [2 x int] + %tmp.0 = getelementptr [2 x int]* %Arr, int 0, int 0 + store int 1, int* %tmp.0 + %tmp.1 = getelementptr [2 x int]* %Arr, int 0, int 1 + store int 2, int* %tmp.1 + + ;; This should turn into a select instruction. + %tmp.3 = getelementptr [2 x int]* %Arr, int 0, int %X + %tmp.4 = load int* %tmp.3 + ret int %tmp.4 +} |