llvm/llvm/test/CodeGen/X86/branchfolding-landingpad-cfg.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
# RUN: llc -mtriple=x86_64-pc-windows-msvc -run-pass=branch-folder -o - %s | FileCheck %s
---
name:            main
body:             |
  ; CHECK-LABEL: name: main
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x7ffff800), %bb.3(0x00000800)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   successors: %bb.2(0x00000800)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   RET 0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2 (machine-block-address-taken, landing-pad, ehfunclet-entry):
  ; CHECK-NEXT:   successors: %bb.3(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   CLEANUPRET
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.3 (landing-pad, ehfunclet-entry):
  ; CHECK-NEXT:   CLEANUPRET
  bb.0:
    successors: %bb.1(0x7ffff800), %bb.5(0x00000800)
    JMP_1 %bb.1

  bb.1:
    successors: %bb.2(0x7ffff800), %bb.4(0x00000800)

    JMP_1 %bb.2

  bb.2:
    successors: %bb.3(0x7ffff800), %bb.4(0x00000800)

    JMP_1 %bb.3

  bb.3:
    successors: %bb.6(0x7ffff800)

    JMP_1 %bb.6

  bb.4 (machine-block-address-taken, landing-pad, ehfunclet-entry):
    successors: %bb.5(0x80000000)
    CLEANUPRET

  bb.5 (landing-pad, ehfunclet-entry):
    CLEANUPRET

  bb.6:
    RET 0
...
---
name:            foo
body:             |
  ; CHECK-LABEL: name: foo
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x7ffff800), %bb.2(0x00000800)
  ; CHECK-NEXT:   liveins: $rcx
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   renamable $eax = MOV32rm renamable $rcx, 1, $noreg, 0, $noreg
  ; CHECK-NEXT:   TEST32rr renamable $eax, renamable $eax, implicit-def $eflags
  ; CHECK-NEXT:   JCC_1 %bb.2, 14, implicit killed $eflags
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   successors: %bb.3(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   INT 3
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2:
  ; CHECK-NEXT:   RET 0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.3 (machine-block-address-taken, landing-pad, ehfunclet-entry):
  ; CHECK-NEXT:   CLEANUPRET
  bb.0:
    successors: %bb.1(0x7ffff800), %bb.2(0x00000800)
    liveins: $rcx

    renamable $eax = MOV32rm renamable $rcx, 1, $noreg, 0, $noreg
    TEST32rr renamable $eax, renamable $eax, implicit-def $eflags
    JCC_1 %bb.2, 14, implicit killed $eflags
    JMP_1 %bb.1

  bb.1:
    successors: %bb.3(0x80000000)
    INT 3

  bb.2:
    RET 0

  bb.3 (machine-block-address-taken, landing-pad, ehfunclet-entry):
    CLEANUPRET
...