blob: 4adc9607c75bccd65cad5345ca35561e3016301c [file] [log] [blame]
Justin Bogner6f6c5f22016-04-25 23:36:50 +00001; RUN: opt < %s -globalopt -S | FileCheck %s
Chris Lattner26fe7eb2008-01-14 02:09:12 +00002
Justin Bogner6f6c5f22016-04-25 23:36:50 +00003; 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 Lattner26fe7eb2008-01-14 02:09:12 +00006@mm = internal global [16 x [31 x double]] zeroinitializer, align 32
7
8define void @test(i32 %X) {
David Blaikie79e6c742015-02-27 19:29:02 +00009 %P = getelementptr [16 x [31 x double]], [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X
Chris Lattner26fe7eb2008-01-14 02:09:12 +000010 store double 1.0, double* %P
11 ret void
12}
13
14define double @get(i32 %X) {
David Blaikie79e6c742015-02-27 19:29:02 +000015 %P = getelementptr [16 x [31 x double]], [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X
David Blaikiea79ac142015-02-27 21:17:42 +000016 %V = load double, double* %P
Chris Lattner26fe7eb2008-01-14 02:09:12 +000017 ret double %V
18}