llvm.org GIT mirror llvm / release_37
Merging r247435: ------------------------------------------------------------------------ r247435 | david.majnemer | 2015-09-11 13:34:34 -0400 (Fri, 11 Sep 2015) | 8 lines [X86] Make sure startproc/endproc are paired We used different conditions to determine if we should emit startproc vs endproc. Use the same condition to ensure that they will always be paired. This fixes PR24374. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_37@253742 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 3 years ago
2 changed file(s) with 38 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
168168 Asm->OutStreamer->PopSection();
169169 }
170170
171 if (shouldEmitMoves)
171 if (shouldEmitMoves || shouldEmitPersonality)
172172 Asm->OutStreamer->EmitWinCFIEndProc();
173173 }
174174
0 ; RUN: llc < %s | FileCheck %s
1 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
2 target triple = "x86_64-w64-windows-gnu"
3
4 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @g, i8* null }]
5
6 declare i32 @__gxx_personality_seh0(...)
7
8 ; Function Attrs: nounwind
9 define void @f() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_seh0 to i8*) {
10 entry:
11 invoke void @g()
12 to label %exit unwind label %lpad
13
14 lpad: ; preds = %entry
15 landingpad { i8*, i32 }
16 cleanup
17 unreachable
18
19 exit: ; preds = %entry
20 unreachable
21 }
22 ; CHECK-LABEL: f:
23 ; CHECK: .seh_proc f
24 ; CHECK: .seh_handler __gxx_personality_seh0, @unwind, @except
25 ; CHECK: callq g
26 ; CHECK: .seh_handlerdata
27 ; CHECK: .seh_endproc
28
29 define void @g() {
30 unreachable
31 }
32 ; CHECK-LABEL: g:
33 ; CHECK: .seh_proc g
34 ; CHECK: .seh_endproc
35
36 attributes #0 = { nounwind }