llvm/llvm/test/CodeGen/AArch64/clear-dead-implicit-def-impdef.ll

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
; RUN: llc -mtriple=arm64-apple-macosx10.13.0 -mcpu=apple-m1 < %s | FileCheck %s

@.str = external constant [9 x i8]

define void @_ZN38SanitizerCommonInterceptors_Scanf_Test8TestBodyEv(ptr %.str.40, ptr %.str.41, ptr %.str.42, ptr %.str.43, ptr %.str.44, ptr %.str.45, ptr nocapture writeonly %.str.47) nounwind {
; CHECK-LABEL: _ZN38SanitizerCommonInterceptors_Scanf_Test8TestBodyEv:
; CHECK:       ; %bb.0: ; %entry
; CHECK-NEXT:    sub sp, sp, #128
; CHECK-NEXT:    stp x28, x27, [sp, #32] ; 16-byte Folded Spill
; CHECK-NEXT:    stp x26, x25, [sp, #48] ; 16-byte Folded Spill
; CHECK-NEXT:    stp x24, x23, [sp, #64] ; 16-byte Folded Spill
; CHECK-NEXT:    stp x22, x21, [sp, #80] ; 16-byte Folded Spill
; CHECK-NEXT:    stp x20, x19, [sp, #96] ; 16-byte Folded Spill
; CHECK-NEXT:    stp x29, x30, [sp, #112] ; 16-byte Folded Spill
; CHECK-NEXT:    mov x24, x6
; CHECK-NEXT:    mov x19, x5
; CHECK-NEXT:    mov x20, x4
; CHECK-NEXT:    mov x21, x3
; CHECK-NEXT:    mov x22, x2
; CHECK-NEXT:    mov x23, x1
; CHECK-NEXT:    mov x25, x0
; CHECK-NEXT:    str xzr, [sp]
; CHECK-NEXT:    mov x0, #0 ; =0x0
; CHECK-NEXT:    mov w1, #1 ; =0x1
; CHECK-NEXT:    bl __ZL9testScanfPKcjz
; CHECK-NEXT:    mov w28, #4 ; =0x4
; CHECK-NEXT:    stp x28, x28, [sp, #8]
; CHECK-NEXT:    str x28, [sp]
; CHECK-NEXT:    mov x0, #0 ; =0x0
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL9testScanfPKcjz
; CHECK-NEXT:    stp x28, xzr, [sp]
; CHECK-NEXT:    mov x0, #0 ; =0x0
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL9testScanfPKcjz
; CHECK-NEXT:    mov w27, #8 ; =0x8
; CHECK-NEXT:    str x27, [sp]
; CHECK-NEXT:    mov x0, #0 ; =0x0
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL9testScanfPKcjz
; CHECK-NEXT:    mov w26, #1 ; =0x1
; CHECK-NEXT:    stp xzr, x26, [sp]
; CHECK-NEXT:    mov x0, #0 ; =0x0
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL9testScanfPKcjz
; CHECK-NEXT:    str x26, [sp]
; CHECK-NEXT:    mov x0, #0 ; =0x0
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL9testScanfPKcjz
; CHECK-NEXT:    str x28, [sp]
; CHECK-NEXT:  Lloh0:
; CHECK-NEXT:    adrp x26, _.str@GOTPAGE
; CHECK-NEXT:  Lloh1:
; CHECK-NEXT:    ldr x26, [x26, _.str@GOTPAGEOFF]
; CHECK-NEXT:    mov x0, x26
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL9testScanfPKcjz
; CHECK-NEXT:    str wzr, [x24]
; CHECK-NEXT:    str x27, [sp]
; CHECK-NEXT:    mov x0, x25
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL20testScanfNoGnuMallocPKcjz
; CHECK-NEXT:    str x28, [sp]
; CHECK-NEXT:    mov x0, x23
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL20testScanfNoGnuMallocPKcjz
; CHECK-NEXT:    str x28, [sp]
; CHECK-NEXT:    mov x0, x22
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL20testScanfNoGnuMallocPKcjz
; CHECK-NEXT:    str x28, [sp]
; CHECK-NEXT:    mov x0, x21
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL20testScanfNoGnuMallocPKcjz
; CHECK-NEXT:    str x28, [sp]
; CHECK-NEXT:    mov x0, x20
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL20testScanfNoGnuMallocPKcjz
; CHECK-NEXT:    str xzr, [sp]
; CHECK-NEXT:    mov x0, x19
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL20testScanfNoGnuMallocPKcjz
; CHECK-NEXT:    str xzr, [sp]
; CHECK-NEXT:    mov x0, x26
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL20testScanfNoGnuMallocPKcjz
; CHECK-NEXT:    mov w8, #1 ; =0x1
; CHECK-NEXT:    stp x8, xzr, [sp, #8]
; CHECK-NEXT:    str xzr, [sp]
; CHECK-NEXT:    mov x0, #0 ; =0x0
; CHECK-NEXT:    mov w1, #0 ; =0x0
; CHECK-NEXT:    bl __ZL20testScanfNoGnuMallocPKcjz
; CHECK-NEXT:    ldp x29, x30, [sp, #112] ; 16-byte Folded Reload
; CHECK-NEXT:    ldp x20, x19, [sp, #96] ; 16-byte Folded Reload
; CHECK-NEXT:    ldp x22, x21, [sp, #80] ; 16-byte Folded Reload
; CHECK-NEXT:    ldp x24, x23, [sp, #64] ; 16-byte Folded Reload
; CHECK-NEXT:    ldp x26, x25, [sp, #48] ; 16-byte Folded Reload
; CHECK-NEXT:    ldp x28, x27, [sp, #32] ; 16-byte Folded Reload
; CHECK-NEXT:    add sp, sp, #128
; CHECK-NEXT:    ret
; CHECK-NEXT:    .loh AdrpLdrGot Lloh0, Lloh1
entry:
  tail call void (ptr, i32, ...) @_ZL9testScanfPKcjz(ptr null, i32 1, i32 0)
  tail call void (ptr, i32, ...) @_ZL9testScanfPKcjz(ptr null, i32 0, i32 4, i32 4, i32 4)
  tail call void (ptr, i32, ...) @_ZL9testScanfPKcjz(ptr null, i32 0, i32 4, i32 0)
  tail call void (ptr, i32, ...) @_ZL9testScanfPKcjz(ptr null, i32 0, i32 8)
  tail call void (ptr, i32, ...) @_ZL9testScanfPKcjz(ptr null, i32 0, i32 0, i32 1)
  tail call void (ptr, i32, ...) @_ZL9testScanfPKcjz(ptr null, i32 0, i32 1)
  tail call void (ptr, i32, ...) @_ZL9testScanfPKcjz(ptr nonnull @.str, i32 0, i32 4)
  store i32 0, ptr %.str.47, align 4
  tail call void (ptr, i32, ...) @_ZL20testScanfNoGnuMallocPKcjz(ptr %.str.40, i32 0, i32 8)
  tail call void (ptr, i32, ...) @_ZL20testScanfNoGnuMallocPKcjz(ptr %.str.41, i32 0, i32 4)
  tail call void (ptr, i32, ...) @_ZL20testScanfNoGnuMallocPKcjz(ptr %.str.42, i32 0, i32 4)
  tail call void (ptr, i32, ...) @_ZL20testScanfNoGnuMallocPKcjz(ptr %.str.43, i32 0, i32 4)
  tail call void (ptr, i32, ...) @_ZL20testScanfNoGnuMallocPKcjz(ptr %.str.44, i32 0, i32 4)
  tail call void (ptr, i32, ...) @_ZL20testScanfNoGnuMallocPKcjz(ptr %.str.45, i32 0, i32 0)
  tail call void (ptr, i32, ...) @_ZL20testScanfNoGnuMallocPKcjz(ptr nonnull @.str, i32 0, i32 0)
  tail call void (ptr, i32, ...) @_ZL20testScanfNoGnuMallocPKcjz(ptr null, i32 0, i32 0, i32 1, i32 0)
  ret void
}

declare void @_ZL9testScanfPKcjz(ptr, i32, ...) local_unnamed_addr

declare void @_ZL20testScanfNoGnuMallocPKcjz(ptr, i32, ...) local_unnamed_addr