Bump version to 19.1.0-rc3
[llvm-project.git] / llvm / test / Transforms / Reg2Mem / catchswitch-crash.ll
blob711be2629b750c5bdc9247f03d1b27dc5ae7feb5
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=reg2mem -S < %s | FileCheck %s
4 declare void @"read_mem"()
6 define void @"memcpy_seh"() personality ptr @__C_specific_handler {
7 ; CHECK-LABEL: @memcpy_seh(
8 ; CHECK-NEXT:  entry:
9 ; CHECK-NEXT:    %"reg2mem alloca point" = bitcast i32 0 to i32
10 ; CHECK-NEXT:    invoke void @read_mem()
11 ; CHECK-NEXT:    to label [[CLEANUP:%.*]] unwind label [[CATCH_DISPATCH:%.*]]
12 ; CHECK:       catch.dispatch:
13 ; CHECK-NEXT:    [[TMP0:%.*]] = catchswitch within none [label %__except] unwind to caller
14 ; CHECK:       __except:
15 ; CHECK-NEXT:    [[TMP1:%.*]] = catchpad within [[TMP0]] [ptr null]
16 ; CHECK-NEXT:    unreachable
17 ; CHECK:       cleanup:
18 ; CHECK-NEXT:    ret void
20 entry:
21   invoke void @"read_mem"()
22   to label %cleanup unwind label %catch.dispatch
24 catch.dispatch:                                   ; preds = %entry
25   %0 = catchswitch within none [label %__except] unwind to caller
27 __except:                                         ; preds = %catch.dispatch
28   %1 = catchpad within %0 [ptr null]
29   unreachable
31 cleanup:                                          ; preds = %entry
32   ret void
35 declare i32 @__C_specific_handler(...)