From dcf037a6f07ef63e74e547cce5f29d758536735c Mon Sep 17 00:00:00 2001 From: John Brawn Date: Thu, 20 Apr 2017 10:10:10 +0000 Subject: [AArch64] Fix handling of integer fp immediates When an integer is used as an fp immediate we're failing to check the return value of getFP64Imm, so invalid values are silently permitted. Fix this by merging together the integer and real handling. llvm-svn: 300828 --- llvm/test/MC/AArch64/basic-a64-diagnostics.s | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'llvm/test') diff --git a/llvm/test/MC/AArch64/basic-a64-diagnostics.s b/llvm/test/MC/AArch64/basic-a64-diagnostics.s index 80e32c48673..ca513327400 100644 --- a/llvm/test/MC/AArch64/basic-a64-diagnostics.s +++ b/llvm/test/MC/AArch64/basic-a64-diagnostics.s @@ -1781,12 +1781,20 @@ ;; Exponent too large fmov d3, #0.0625 fmov s2, #32.0 + fmov s2, #32 + fmov v0.4s, #-32 // CHECK-ERROR: error: expected compatible register or floating-point constant // CHECK-ERROR-NEXT: fmov d3, #0.0625 // CHECK-ERROR-NEXT: ^ // CHECK-ERROR-NEXT: error: expected compatible register or floating-point constant // CHECK-ERROR-NEXT: fmov s2, #32.0 // CHECK-ERROR-NEXT: ^ +// CHECK-ERROR-NEXT: error: expected compatible register or floating-point constant +// CHECK-ERROR-NEXT: fmov s2, #32 +// CHECK-ERROR-NEXT: ^ +// CHECK-ERROR-NEXT: error: expected compatible register or floating-point constant +// CHECK-ERROR-NEXT: fmov v0.4s, #-32 +// CHECK-ERROR-NEXT: ^ ;; Fraction too precise fmov s9, #1.03125 @@ -1796,6 +1804,12 @@ // CHECK-ERROR-NEXT: ^ // CHECK-ERROR-NEXT: error: expected compatible register or floating-point constant // CHECK-ERROR-NEXT: fmov s28, #1.96875 +// CHECK-ERROR-NEXT: ^ + + ;; Explicitly encoded value too large + fmov s15, #0x100 +// CHECK-ERROR: error: encoded floating point value out of range +// CHECK-ERROR-NEXT: fmov s15, #0x100 // CHECK-ERROR-NEXT: ^ ;; No particular reason, but a striking omission -- cgit v1.2.3