blob: 35d55a907375471225b0983bf569ee7d7c6ff834 [file] [log] [blame]
Hans Wennborgc4b1d202016-09-22 19:50:05 +00001; RUN: llc < %s -O1 -mtriple=x86_64-pc-win32 | FileCheck %s -check-prefix=ASM
2; RUN: llc < %s -O1 -mtriple=x86_64-pc-win32 -filetype=obj -o %t
3; RUN: llvm-readobj -unwind %t | FileCheck %s -check-prefix=READOBJ
4
5declare void @g(i32)
6
7define i32 @not_leaf(i32) uwtable {
8entry:
9 call void @g(i32 42)
10 ret i32 42
11
12; ASM-LABEL: not_leaf:
13; ASM: .seh
14
15; READOBJ: RuntimeFunction {
16; READOBJ-NEXT: StartAddress: not_leaf
17; READOBJ-NEXT: EndAddress: not_leaf
18}
19
20define void @leaf_func(i32) uwtable {
21entry:
22 tail call void @g(i32 42)
23 ret void
24
25; A Win64 "leaf" function gets no .seh directives in the asm.
26; ASM-LABEL: leaf_func:
27; ASM-NOT: .seh
28
29; and no unwind info in the object file.
30; READOBJ-NOT: leaf_func
31}
Reid Kleckner5c0bdef2017-05-03 23:13:42 +000032
33define void @naked_func() naked {
34 call void asm sideeffect "ret", ""()
35 unreachable
36}
37; ASM-LABEL: naked_func:
38; ASM-NOT: .seh_
39; ASM: ret
40; ASM-NOT: .seh_