1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -passes=newgvn -S < %s | FileCheck %s
3 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
4 target triple = "i686-pc-windows-msvc"
6 %eh.ThrowInfo = type { i32, ptr, ptr, ptr }
7 %struct.A = type { ptr }
9 @"_TI1?AUA@@" = external constant %eh.ThrowInfo
11 define i8 @f() personality ptr @__CxxFrameHandler3 {
12 ; CHECK-LABEL: define i8 @f() personality ptr @__CxxFrameHandler3 {
14 ; CHECK-NEXT: [[B:%.*]] = alloca i8, align 1
15 ; CHECK-NEXT: [[C:%.*]] = alloca i8, align 1
16 ; CHECK-NEXT: store i8 42, ptr [[B]], align 1
17 ; CHECK-NEXT: store i8 13, ptr [[C]], align 1
18 ; CHECK-NEXT: invoke void @_CxxThrowException(ptr [[B]], ptr nonnull @"_TI1?AUA@@")
19 ; CHECK-NEXT: to label [[UNREACHABLE:%.*]] unwind label [[CATCH_DISPATCH:%.*]]
20 ; CHECK: catch.dispatch:
21 ; CHECK-NEXT: [[CS1:%.*]] = catchswitch within none [label %catch] unwind to caller
23 ; CHECK-NEXT: [[CATCHPAD:%.*]] = catchpad within [[CS1]] [ptr null, i32 64, ptr null]
24 ; CHECK-NEXT: store i8 5, ptr [[B]], align 1
25 ; CHECK-NEXT: catchret from [[CATCHPAD]] to label [[TRY_CONT:%.*]]
27 ; CHECK-NEXT: [[LOAD_B:%.*]] = load i8, ptr [[B]], align 1
28 ; CHECK-NEXT: [[LOAD_C:%.*]] = load i8, ptr [[C]], align 1
29 ; CHECK-NEXT: [[ADD:%.*]] = add i8 [[LOAD_B]], [[LOAD_C]]
30 ; CHECK-NEXT: ret i8 [[ADD]]
32 ; CHECK-NEXT: unreachable
39 invoke void @_CxxThrowException(ptr %b, ptr nonnull @"_TI1?AUA@@")
40 to label %unreachable unwind label %catch.dispatch
42 catch.dispatch: ; preds = %entry
43 %cs1 = catchswitch within none [label %catch] unwind to caller
45 catch: ; preds = %catch.dispatch
46 %catchpad = catchpad within %cs1 [ptr null, i32 64, ptr null]
48 catchret from %catchpad to label %try.cont
50 try.cont: ; preds = %catch
51 %load_b = load i8, ptr %b
52 %load_c = load i8, ptr %c
53 %add = add i8 %load_b, %load_c
56 unreachable: ; preds = %entry
60 declare i32 @__CxxFrameHandler3(...)
62 declare x86_stdcallcc void @_CxxThrowException(ptr, ptr)