blob: 38fc981d2b7fdbb20d0b2f9ab5f4beb7fa354cb5 [file] [log] [blame]
David Majnemer086fec22016-01-08 08:03:55 +00001; RUN: llc < %s | FileCheck %s
2
3target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
4target triple = "x86_64-pc-windows-msvc"
5
6declare void @throw()
7
8declare i32 @__CxxFrameHandler3(...)
9
10define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
11entry:
12 %alloca2 = alloca i8*, align 4
13 %alloca1 = alloca i8*, align 4
14 store volatile i8* null, i8** %alloca1
15 invoke void @throw()
16 to label %unreachable unwind label %catch.dispatch
17
18; CHECK-LABEL: test1:
19; CHECK: movq $0, -16(%rbp)
20; CHECK: callq throw
21
22catch.dispatch: ; preds = %entry
23 %cs = catchswitch within none [label %catch.pad] unwind to caller
24
25catch.pad: ; preds = %catch.dispatch
26 %cp = catchpad within %cs [i8* null, i32 0, i8** %alloca1]
27 store volatile i8* null, i8** %alloca1
28 %bc1 = bitcast i8** %alloca1 to i8*
29 call void @llvm.lifetime.end(i64 4, i8* nonnull %bc1)
30 %bc2 = bitcast i8** %alloca2 to i8*
31 call void @llvm.lifetime.start(i64 4, i8* %bc2)
32 store volatile i8* null, i8** %alloca1
33 unreachable
34
35; CHECK-LABEL: "?catch$2@?0?test1@4HA"
36; CHECK: movq $0, -16(%rbp)
37; CHECK: movq $0, -16(%rbp)
38; CHECK: ud2
39
40unreachable: ; preds = %entry
41 unreachable
42}
43
44; CHECK-LABEL: $cppxdata$test1:
45; CHECK: .long 32 # CatchObjOffset
46
47; Function Attrs: argmemonly nounwind
48declare void @llvm.lifetime.start(i64, i8* nocapture) #0
49
50; Function Attrs: argmemonly nounwind
51declare void @llvm.lifetime.end(i64, i8* nocapture) #0
52
53attributes #0 = { argmemonly nounwind }