51 lines · plain
1; RUN: opt -aa-pipeline=globals-aa,basic-aa -passes='require<globals-aa>,gvn' -S < %s | FileCheck %s2 3target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"4target triple = "x86_64-unknown-linux-gnu"5 6@deallocCalled = internal global i8 0, align 17 8define internal ptr @_i_Associated__dealloc() {9entry:10 store i8 1, ptr @deallocCalled, align 111 ret ptr null12}13 14; CHECK-LABEL: @main()15define dso_local i32 @main() {16entry:17 %tmp0 = call ptr @llvm.stacksave() #118 %tmp6 = load i8, ptr @deallocCalled, align 119 %tobool = icmp ne i8 %tmp6, 020 br i1 %tobool, label %if.else, label %if.end21 22if.else: ; preds = %entry23 call void @__assert_fail() #024 unreachable25 26; CHECK-LABEL: if.end:27; CHECK-NEXT: call void @llvm.stackrestore28; CHECK-NOT: load i8, ptr @deallocCalled29if.end: ; preds = %entry30 call void @llvm.stackrestore(ptr %tmp0)31 %tmp7 = load i8, ptr @deallocCalled, align 132 %tobool3 = icmp ne i8 %tmp7, 033 br i1 %tobool3, label %if.end6, label %if.else534 35if.else5: ; preds = %if.end36 call void @__assert_fail() #037 unreachable38 39if.end6: ; preds = %if.end40 store i8 0, ptr @deallocCalled, align 141 ret i32 042}43 44declare ptr @llvm.stacksave() #145declare void @llvm.stackrestore(ptr) #146declare dso_local void @__assert_fail() #047 48attributes #0 = { noreturn nosync nounwind }49attributes #1 = { nosync nounwind }50 51