summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorARATA Mizuki <minorinoki@gmail.com>2021-08-26 12:38:41 +0900
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-28 14:25:14 -0400
commit922c6bc8dd8d089cfe4b90ec2120cb48959ba2b5 (patch)
tree0c67d26cd13055b4141212644b0985e9a01e2e5d
parent8057a350c207b866a0187d6150658f051679696b (diff)
downloadhaskell-922c6bc8dd8d089cfe4b90ec2120cb48959ba2b5.tar.gz
Add a test for #20275
-rw-r--r--testsuite/tests/codeGen/should_run/T20275.hs6
-rw-r--r--testsuite/tests/codeGen/should_run/T20275.stdout2
-rw-r--r--testsuite/tests/codeGen/should_run/all.T3
3 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_run/T20275.hs b/testsuite/tests/codeGen/should_run/T20275.hs
new file mode 100644
index 0000000000..91e78144a7
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T20275.hs
@@ -0,0 +1,6 @@
+import Numeric
+import GHC.Float
+
+main = do
+ putStrLn (showHex (castFloatToWord32 (abs (castWord32ToFloat 0xFFC00000))) "")
+ putStrLn (showHex (castDoubleToWord64 (abs (castWord64ToDouble 0xFFF8000000000000))) "")
diff --git a/testsuite/tests/codeGen/should_run/T20275.stdout b/testsuite/tests/codeGen/should_run/T20275.stdout
new file mode 100644
index 0000000000..9464944793
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T20275.stdout
@@ -0,0 +1,2 @@
+7fc00000
+7ff8000000000000
diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T
index 4ea31f9011..36772a7840 100644
--- a/testsuite/tests/codeGen/should_run/all.T
+++ b/testsuite/tests/codeGen/should_run/all.T
@@ -210,6 +210,9 @@ test('T16846', [only_ways(['optasm']), exit_code(1)], compile_and_run, [''])
test('T17920', cmm_src, compile_and_run, [''])
test('T18527', normal, compile_and_run, ['T18527FFI.c'])
test('T19149', only_ways('sanity'), compile_and_run, ['T19149_c.c'])
+test('T20275', [when(unregisterised(), skip),
+ unless(arch('i386') or arch('x86_64') or arch('powerpc') or arch('powerpc64') or arch('powerpc64le') or arch('aarch64'), skip)],
+ compile_and_run, [''])
test('CallConv', [when(unregisterised(), skip),
unless(arch('x86_64') or arch('aarch64'), skip),