Skip to content

Commit 309e41d

Browse files
committed
[DAG] Add test coverage for Issue #66603
1 parent 93373c3 commit 309e41d

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

llvm/test/CodeGen/AArch64/pr66603.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2+
; RUN: llc < %s -mtriple=aarch64-- -verify-machineinstrs | FileCheck %s
3+
4+
define i32 @PR66603(double %x) nounwind {
5+
; CHECK-LABEL: PR66603:
6+
; CHECK: // %bb.0:
7+
; CHECK-NEXT: fcvtzs w0, d0
8+
; CHECK-NEXT: ret
9+
%as_i8 = fptosi double %x to i8
10+
%frozen_i8 = freeze i8 %as_i8
11+
%ext = sext i8 %frozen_i8 to i32
12+
ret i32 %ext
13+
}

llvm/test/CodeGen/RISCV/pr66603.ll

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2+
; RUN: llc < %s -mtriple=riscv32-- -mattr=+d -verify-machineinstrs | FileCheck %s -check-prefix=RV32
3+
; RUN: llc < %s -mtriple=riscv64-- -mattr=+d -verify-machineinstrs | FileCheck %s -check-prefix=RV64
4+
5+
define i32 @PR66603(double %x) nounwind {
6+
; RV32-LABEL: PR66603:
7+
; RV32: # %bb.0:
8+
; RV32-NEXT: fcvt.w.d a0, fa0, rtz
9+
; RV32-NEXT: ret
10+
;
11+
; RV64-LABEL: PR66603:
12+
; RV64: # %bb.0:
13+
; RV64-NEXT: fcvt.l.d a0, fa0, rtz
14+
; RV64-NEXT: ret
15+
%as_i8 = fptosi double %x to i8
16+
%frozen_i8 = freeze i8 %as_i8
17+
%ext = sext i8 %frozen_i8 to i32
18+
ret i32 %ext
19+
}

0 commit comments

Comments
 (0)