Sergei Larin | 94be2de | 2016-01-22 21:18:20 +0000 | [diff] [blame] | 1 | ; RUN: opt -globalopt -S < %s | FileCheck %s |
| 2 | ; CHECK: @Y.f0 |
| 3 | ; CHECK: section ".foo" |
| 4 | ; CHECK: @Y.f1 |
| 5 | ; CHECK: section ".foo" |
| 6 | |
| 7 | %struct.xyz = type { double, i32 } |
| 8 | |
| 9 | @Y = internal global %struct.xyz* null ,section ".foo" ; <%struct.xyz**> [#uses=2] |
| 10 | @numf2s = external global i32 ; <i32*> [#uses=1] |
| 11 | |
| 12 | define void @init_net() { |
| 13 | entry: |
| 14 | %0 = load i32, i32* @numf2s, align 4 ; <i32> [#uses=1] |
| 15 | %mallocsize2 = shl i32 %0, 4 ; <i32> [#uses=1] |
| 16 | %malloccall3 = tail call i8* @malloc(i32 %mallocsize2) ; <i8*> [#uses=1] |
| 17 | %1 = bitcast i8* %malloccall3 to %struct.xyz* ; <%struct.xyz*> [#uses=1] |
| 18 | store %struct.xyz* %1, %struct.xyz** @Y, align 8 |
| 19 | ret void |
| 20 | } |
| 21 | |
| 22 | define void @load_train() { |
| 23 | entry: |
| 24 | %0 = load %struct.xyz*, %struct.xyz** @Y, align 8 ; <%struct.xyz*> [#uses=0] |
| 25 | ret void |
| 26 | } |
| 27 | |
| 28 | declare noalias i8* @malloc(i32) |