1; RUN: opt -passes=globalopt -S < %s | FileCheck %s 2; CHECK: @Y 3; CHECK: section ".foo" 4 5%struct.xyz = type { double, i32 } 6 7@Y = internal global %struct.xyz* null ,section ".foo" ; <%struct.xyz**> [#uses=2] 8@numf2s = external global i32 ; <i32*> [#uses=1] 9 10define void @init_net() #0 { 11; CHECK-LABEL: init_net( 12; CHECK: load i32, i32* @numf2s 13; CHECK: call i8* @malloc 14; CHECK: store %struct.xyz* {{.*}}, %struct.xyz** @Y 15entry: 16 %0 = load i32, i32* @numf2s, align 4 ; <i32> [#uses=1] 17 %mallocsize2 = shl i32 %0, 4 ; <i32> [#uses=1] 18 %malloccall3 = tail call i8* @malloc(i32 %mallocsize2) ; <i8*> [#uses=1] 19 %1 = bitcast i8* %malloccall3 to %struct.xyz* ; <%struct.xyz*> [#uses=1] 20 store %struct.xyz* %1, %struct.xyz** @Y, align 8 21 ret void 22} 23 24define %struct.xyz* @load_train() #0 { 25; CHECK-LABEL: load_train( 26; CHECK: load %struct.xyz*, %struct.xyz** @Y 27entry: 28 %0 = load %struct.xyz*, %struct.xyz** @Y, align 8 ; <%struct.xyz*> [#uses=0] 29 ret %struct.xyz* %0 30} 31 32declare noalias i8* @malloc(i32) 33 34attributes #0 = { null_pointer_is_valid } 35