[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / llvm / test / CodeGen / X86 / no-seh-unwind-inline-asm-codegen.ll
blob1f93220fb1eb69bb8437eecaa50b0abcaa422b0c
1 ; RUN: llc < %s | FileCheck %s
3 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-pc-windows-msvc19.28.29914"
6 @str = private unnamed_addr constant [6 x i8] c"Boom!\00", align 1
8 define dso_local void @trap() {
9 entry:
10   unreachable
13 define dso_local void @test() personality ptr @__CxxFrameHandler3 {
14 entry:
16 ; CHECK-NOT: .Ltmp0:
17 ; CHECK: callq  trap
18 ; CHECK-NOT: .Ltmp1:
20   invoke void asm sideeffect "call trap", "~{dirflag},~{fpsr},~{flags}"()
21           to label %exit unwind label %except
23 exit:
24   ret void
26 except:
28 ; CHECK-LABEL: "?dtor$2@?0?test@4HA":
29 ; CHECK: callq  printf
31   %0 = cleanuppad within none []
32   call void (ptr, ...) @printf(ptr @str) [ "funclet"(token %0) ]
33   cleanupret from %0 unwind to caller
36 declare dso_local i32 @__CxxFrameHandler3(...)
38 declare dso_local void @printf(ptr, ...)
40 ; SEH Table
42 ; CHECK-LABEL: $cppxdata$test:
43 ; CHECK-NEXT:    .long    429065506                       # MagicNumber
44 ; CHECK-NEXT:    .long    1                               # MaxState
45 ; CHECK-NEXT:    .long    ($stateUnwindMap$test)@IMGREL   # UnwindMap
46 ; CHECK-NEXT:    .long    0                               # NumTryBlocks
47 ; CHECK-NEXT:    .long    0                               # TryBlockMap
48 ; CHECK-NEXT:    .long    1                               # IPMapEntries
49 ; CHECK-NEXT:    .long    ($ip2state$test)@IMGREL         # IPToStateXData
50 ; CHECK-NEXT:    .long    40                              # UnwindHelp
51 ; CHECK-NEXT:    .long    0                               # ESTypeList
52 ; CHECK-NEXT:    .long    1                               # EHFlags
53 ; CHECK-NEXT:$stateUnwindMap$test:
54 ; CHECK-NEXT:    .long    -1                              # ToState
55 ; CHECK-NEXT:    .long    "?dtor$2@?0?test@4HA"@IMGREL    # Action
56 ; CHECK-NEXT:$ip2state$test:
57 ; CHECK-NEXT:    .long    .Lfunc_begin0@IMGREL            # IP
58 ; CHECK-NEXT:    .long    -1                              # ToState