Skip to content

Commit

Permalink
[X86] Add test case for PR44412. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
topperc committed Dec 30, 2019
1 parent 70f8dd4 commit 6185dc0
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions llvm/test/CodeGen/X86/pr44412.ll
@@ -0,0 +1,36 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
;RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s

define void @bar(i32 %0, i32 %1) nounwind {
; CHECK-LABEL: bar:
; CHECK: # %bb.0:
; CHECK-NEXT: pushq %rbx
; CHECK-NEXT: testl %edi, %edi
; CHECK-NEXT: je .LBB0_3
; CHECK-NEXT: # %bb.1: # %.preheader
; CHECK-NEXT: movl %edi, %ebx
; CHECK-NEXT: decl %ebx
; CHECK-NEXT: .p2align 4, 0x90
; CHECK-NEXT: .LBB0_2: # =>This Inner Loop Header: Depth=1
; CHECK-NEXT: movl %ebx, %edi
; CHECK-NEXT: callq foo
; CHECK-NEXT: decl %ebx
; CHECK-NEXT: cmpl $-1, %ebx
; CHECK-NEXT: jne .LBB0_2
; CHECK-NEXT: .LBB0_3:
; CHECK-NEXT: popq %rbx
; CHECK-NEXT: retq
%3 = icmp eq i32 %0, 0
br i1 %3, label %8, label %4

4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = add nsw i32 %5, -1
tail call void @foo(i32 %6)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %4

8: ; preds = %4, %2
ret void
}
declare void @foo(i32)

0 comments on commit 6185dc0

Please sign in to comment.