32 lines · plain
1; RUN: opt < %s -aa-pipeline=globals-aa -passes='require<globals-aa>,dse' -S | FileCheck %s2 3@X = internal global i32 44 5define i32 @test0() {6; CHECK-LABEL: @test07; CHECK: store i32 0, ptr @X8; CHECK-NEXT: call i32 @func_readonly() #09; CHECK-NEXT: store i32 1, ptr @X10 store i32 0, ptr @X11 %x = call i32 @func_readonly() #012 store i32 1, ptr @X13 ret i32 %x14}15 16define i32 @test1() {17; CHECK-LABEL: @test118; CHECK-NOT: store19; CHECK: call i32 @func_read_argmem_only() #120; CHECK-NEXT: store i32 3, ptr @X21 store i32 2, ptr @X22 %x = call i32 @func_read_argmem_only() #123 store i32 3, ptr @X24 ret i32 %x25}26 27declare i32 @func_readonly() #028declare i32 @func_read_argmem_only() #129 30attributes #0 = { readonly nounwind }31attributes #1 = { readonly argmemonly nounwind }32