1; Verify that section assignment is copied during SROA
2; RUN: opt < %s -globalopt -S | FileCheck %s
3; CHECK: @G.0
4; CHECK: section ".foo"
5; CHECK: @G.1
6; CHECK: section ".foo"
7; CHECK: @G.2
8; CHECK: section ".foo"
9
10%T = type { double, double, double }
11@G = internal global %T zeroinitializer, align 16, section ".foo"
12
13define void @test() {
14  store double 1.0, double* getelementptr (%T, %T* @G, i32 0, i32 0), align 16
15  store double 2.0, double* getelementptr (%T, %T* @G, i32 0, i32 1), align 8
16  store double 3.0, double* getelementptr (%T, %T* @G, i32 0, i32 2), align 16
17  ret void
18}
19
20define double @test2() {
21  %V1 = load double, double* getelementptr (%T, %T* @G, i32 0, i32 0), align 16
22  %V2 = load double, double* getelementptr (%T, %T* @G, i32 0, i32 1), align 8
23  %V3 = load double, double* getelementptr (%T, %T* @G, i32 0, i32 2), align 16
24  %R = fadd double %V1, %V2
25  %R2 = fadd double %R, %V3
26  ret double %R2
27}
28