brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 7cb3a96 Raw
42 lines · plain
1; RUN: opt < %s -passes=globalopt -S | FileCheck %s2 3; When removing the store to @global in @foo, the pass would incorrectly return4; false. This was caught by the pass return status check that is hidden under5; EXPENSIVE_CHECKS.6 7; CHECK: @global = internal unnamed_addr global ptr null, align 18 9; CHECK-LABEL: @foo10; CHECK-NEXT: entry:11; CHECK-NEXT: ret i16 undef12 13@global = internal unnamed_addr global ptr null, align 114 15; Function Attrs: nofree noinline norecurse nounwind writeonly16define i16 @foo(i16 %c) local_unnamed_addr #0 {17entry:18  %local1.addr = alloca i16, align 119  store ptr %local1.addr, ptr @global, align 120  ret i16 undef21}22 23; Function Attrs: noinline nounwind writeonly24define i16 @bar() local_unnamed_addr #1 {25entry:26  %local2 = alloca [1 x i16], align 127  call void @llvm.lifetime.start.p0(ptr nonnull %local2)28  store ptr %local2, ptr @global, align 129  call void @llvm.lifetime.end.p0(ptr nonnull %local2)30  ret i16 undef31}32 33; Function Attrs: argmemonly nounwind willreturn34declare void @llvm.lifetime.start.p0(ptr nocapture) #235 36; Function Attrs: argmemonly nounwind willreturn37declare void @llvm.lifetime.end.p0(ptr nocapture) #238 39attributes #0 = { nofree noinline norecurse nounwind writeonly }40attributes #1 = { noinline nounwind writeonly }41attributes #2 = { argmemonly nounwind willreturn }42