1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=globalopt -S < %s | FileCheck %s
4 @g = internal global ptr null, align 8
6 define signext i32 @f() local_unnamed_addr {
9 ; CHECK-NEXT: call void @f1()
10 ; CHECK-NEXT: store i32 1, ptr @g.body, align 4
11 ; CHECK-NEXT: call void @f1()
12 ; CHECK-NEXT: store i8 2, ptr @g.body, align 4
13 ; CHECK-NEXT: ret i32 1
16 %call = call ptr @malloc(i64 4)
17 store ptr %call, ptr @g, align 8
19 %0 = load ptr, ptr @g, align 8
20 store i32 1, ptr %0, align 4
22 %1 = load ptr, ptr @g, align 8
23 store i8 2, ptr %1, align 4
27 define signext i32 @main() {
30 ; CHECK-NEXT: [[CALL:%.*]] = call signext i32 @f()
31 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @g.body, align 4
32 ; CHECK-NEXT: ret i32 [[TMP0]]
35 %call = call signext i32 @f()
36 %0 = load ptr, ptr @g, align 8
37 %1 = load i32, ptr %0, align 4
41 declare noalias align 16 ptr @malloc(i64) allockind("alloc,uninitialized") allocsize(0)