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