diff --git a/compiler/GHC/Cmm/Lexer.x b/compiler/GHC/Cmm/Lexer.x
index 5a422933c203e22dc875957b181020444c3e54c9..0c07cbb2cae4f93400884224c3ccae555574b21f 100644
--- a/compiler/GHC/Cmm/Lexer.x
+++ b/compiler/GHC/Cmm/Lexer.x
@@ -62,7 +62,7 @@ $namechar  = [$namebegin $digit]
 @hexadecimal = $hexit+
 @exponent    = [eE] [\-\+]? @decimal
 
-@floating_point = @decimal \. @decimal @exponent? | @decimal @exponent
+@floating_point = [\-]? (@decimal \. @decimal @exponent? | @decimal @exponent)
 
 @escape      = \\ ([abfnrt\\\'\"\?] | x $hexit{1,2} | $octit{1,3})
 @strchar     = ($printable # [\"\\]) | @escape
diff --git a/testsuite/tests/cmm/should_compile/T24224.cmm b/testsuite/tests/cmm/should_compile/T24224.cmm
new file mode 100644
index 0000000000000000000000000000000000000000..748e8ad6021b2bbf58e4568aa626d2831c725f45
--- /dev/null
+++ b/testsuite/tests/cmm/should_compile/T24224.cmm
@@ -0,0 +1,3 @@
+main () {
+  float64 f1; f1 = (-1.0 :: float64);
+}
diff --git a/testsuite/tests/cmm/should_compile/T24224.stderr b/testsuite/tests/cmm/should_compile/T24224.stderr
new file mode 100644
index 0000000000000000000000000000000000000000..9172720b8dfd0f4ac9c1b823691c6a3d70fd6924
--- /dev/null
+++ b/testsuite/tests/cmm/should_compile/T24224.stderr
@@ -0,0 +1,14 @@
+
+==================== Output Cmm ====================
+[main() { //  []
+         { info_tbls: []
+           stack_info: arg_space: 8
+         }
+     {offset
+       _lbl_:
+           __locVar_::F64 = -1.0 :: W64;
+           goto c2;
+     }
+ }]
+
+
diff --git a/testsuite/tests/cmm/should_compile/all.T b/testsuite/tests/cmm/should_compile/all.T
index 45f0b50fcbcead1df8986456b354cbeb93effa76..41f32175a8ebbba2c2e35483e86dfd455ec04374 100644
--- a/testsuite/tests/cmm/should_compile/all.T
+++ b/testsuite/tests/cmm/should_compile/all.T
@@ -12,3 +12,4 @@ test('T16930', normal, makefile_test, ['T16930'])
 test('T17442', normal, compile, [''])
 test('T20725', normal, compile, ['-package ghc'])
 test('T23610', normal, makefile_test, ['T23610'])
+test('T24224', [cmm_src, grep_errmsg(r'(F64.*);', [1])], compile, ['-no-hs-main -ddump-cmm -dsuppress-all -dsuppress-uniques'])