| Chandler Carruth | a5a29f9 | 2012-07-02 12:47:22 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -globalopt -S | grep "16 x .31 x double.. zeroinitializer" |
| Chris Lattner | 26fe7eb | 2008-01-14 02:09:12 +0000 | [diff] [blame] | 2 | |
| 3 | ; The 'X' indices could be larger than 31. Do not SROA the outer indices of this array. |
| 4 | @mm = internal global [16 x [31 x double]] zeroinitializer, align 32 |
| 5 | |
| 6 | define void @test(i32 %X) { |
| David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 7 | %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] | 8 | store double 1.0, double* %P |
| 9 | ret void |
| 10 | } |
| 11 | |
| 12 | define double @get(i32 %X) { |
| David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 13 | %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^] | 14 | %V = load double, double* %P |
| Chris Lattner | 26fe7eb | 2008-01-14 02:09:12 +0000 | [diff] [blame] | 15 | ret double %V |
| 16 | } |