Justin Bogner | 6f6c5f2 | 2016-04-25 23:36:50 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -globalopt -S | FileCheck %s |
Chris Lattner | 26fe7eb | 2008-01-14 02:09:12 +0000 | [diff] [blame] | 2 | |
Justin Bogner | 6f6c5f2 | 2016-04-25 23:36:50 +0000 | [diff] [blame] | 3 | ; The 'X' indices could be larger than 31. Do not SROA the outer |
| 4 | ; indices of this array. |
| 5 | ; CHECK: @mm = {{.*}} [16 x [31 x double]] zeroinitializer |
Chris Lattner | 26fe7eb | 2008-01-14 02:09:12 +0000 | [diff] [blame] | 6 | @mm = internal global [16 x [31 x double]] zeroinitializer, align 32 |
| 7 | |
| 8 | define void @test(i32 %X) { |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 9 | %P = getelementptr [16 x [31 x double]], [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X |
Chris Lattner | 26fe7eb | 2008-01-14 02:09:12 +0000 | [diff] [blame] | 10 | store double 1.0, double* %P |
| 11 | ret void |
| 12 | } |
| 13 | |
| 14 | define double @get(i32 %X) { |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 15 | %P = getelementptr [16 x [31 x double]], [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 16 | %V = load double, double* %P |
Chris Lattner | 26fe7eb | 2008-01-14 02:09:12 +0000 | [diff] [blame] | 17 | ret double %V |
| 18 | } |