• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -basicaa -gvn -S < %s | FileCheck %s
2target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
3target triple = "i686-pc-windows-msvc"
4
5%eh.ThrowInfo = type { i32, i8*, i8*, i8* }
6%struct.A = type { i32* }
7
8@"_TI1?AUA@@" = external constant %eh.ThrowInfo
9
10define i8 @f() personality i32 (...)* @__CxxFrameHandler3 {
11entry:
12  %b = alloca i8
13  %c = alloca i8
14  store i8 42, i8* %b
15  store i8 13, i8* %c
16  invoke void @_CxxThrowException(i8* %b, %eh.ThrowInfo* nonnull @"_TI1?AUA@@")
17          to label %unreachable unwind label %catch.dispatch
18
19catch.dispatch:                                   ; preds = %entry
20  %cs1 = catchswitch within none [label %catch] unwind to caller
21
22catch:                                            ; preds = %catch.dispatch
23  %catchpad = catchpad within %cs1 [i8* null, i32 64, i8* null]
24  store i8 5, i8* %b
25  catchret from %catchpad to label %try.cont
26
27try.cont:                                         ; preds = %catch
28  %load_b = load i8, i8* %b
29  %load_c = load i8, i8* %c
30  %add = add i8 %load_b, %load_c
31  ret i8 %add
32
33unreachable:                                      ; preds = %entry
34  unreachable
35}
36; CHECK-LABEL: define i8 @f(
37; CHECK:       %[[load_b:.*]] = load i8, i8* %b
38; CHECK-NEXT:  %[[load_c:.*]] = load i8, i8* %c
39; CHECK-NEXT:  %[[add:.*]] = add i8 %[[load_b]], %[[load_c]]
40; CHECK-NEXT:  ret i8 %[[add]]
41
42declare i32 @__CxxFrameHandler3(...)
43
44declare x86_stdcallcc void @_CxxThrowException(i8*, %eh.ThrowInfo*)
45