[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / Transforms / GlobalOpt / MallocSROA-section.ll
blob3925da09efff399d9d29d4fd0a5f26206b9f530a
1 ; RUN: opt -passes=globalopt -S < %s | FileCheck %s
2 ; CHECK: @Y = {{.*}} section ".foo"
4 %struct.xyz = type { double, i32 }
6 @Y = internal global %struct.xyz* null ,section ".foo"            ; <%struct.xyz**> [#uses=2]
7 @numf2s = external global i32                     ; <i32*> [#uses=1]
9 define void @init_net()  {
10 entry:
11   %0 = load i32, i32* @numf2s, align 4                 ; <i32> [#uses=1]
12   %mallocsize2 = shl i32 %0, 4                    ; <i32> [#uses=1]
13   %malloccall3 = tail call i8* @malloc(i32 %mallocsize2)  ; <i8*> [#uses=1]
14   %1 = bitcast i8* %malloccall3 to %struct.xyz*   ; <%struct.xyz*> [#uses=1]
15   store %struct.xyz* %1, %struct.xyz** @Y, align 8
16   ret void
19 define void @load_train()  {
20 entry:
21   %0 = load %struct.xyz*, %struct.xyz** @Y, align 8             ; <%struct.xyz*> [#uses=0]
22   ret void
25 declare noalias i8* @malloc(i32)