summaryrefslogtreecommitdiff
path: root/testsuite/tests/llvm
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2015-06-16 20:16:08 +0200
committerBen Gamari <ben@smart-cactus.org>2015-06-16 20:16:08 +0200
commit681973c31c614185229bdae4f6b7ab4f6e64753d (patch)
tree9ef8257217c05f4a05828a04e24199f42e0e2fe0 /testsuite/tests/llvm
parentd20031d4c88b256cdae264cb05d9d850e973d956 (diff)
downloadhaskell-681973c31c614185229bdae4f6b7ab4f6e64753d.tar.gz
Encode alignment in MO_Memcpy and friends
Summary: Alignment needs to be a compile-time constant. Previously the code generators had to jump through hoops to ensure this was the case as the alignment was passed as a CmmExpr in the arguments list. Now we take care of this up front. This fixes #8131. Authored-by: Reid Barton <rwbarton@gmail.com> Dusted-off-by: Ben Gamari <ben@smart-cactus.org> Tests for T8131 Test Plan: Validate Reviewers: rwbarton, austin Reviewed By: rwbarton, austin Subscribers: bgamari, carter, thomie Differential Revision: https://phabricator.haskell.org/D624 GHC Trac Issues: #8131
Diffstat (limited to 'testsuite/tests/llvm')
-rw-r--r--testsuite/tests/llvm/should_compile/T8131b.hs9
-rw-r--r--testsuite/tests/llvm/should_compile/all.T2
2 files changed, 10 insertions, 1 deletions
diff --git a/testsuite/tests/llvm/should_compile/T8131b.hs b/testsuite/tests/llvm/should_compile/T8131b.hs
new file mode 100644
index 0000000000..b9bc1f6184
--- /dev/null
+++ b/testsuite/tests/llvm/should_compile/T8131b.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE MagicHash, UnboxedTuples #-}
+import GHC.Prim
+import GHC.IO
+
+main = IO $ \s ->
+ let (# s1, p0 #) = newByteArray# 10# s
+ (# s2, p #) = unsafeFreezeByteArray# p0 s1
+ (# s3, q #) = newByteArray# 10# s2
+ in (# copyByteArray# p 0# q 0# 10# s, () #)
diff --git a/testsuite/tests/llvm/should_compile/all.T b/testsuite/tests/llvm/should_compile/all.T
index b630645f1e..0082635445 100644
--- a/testsuite/tests/llvm/should_compile/all.T
+++ b/testsuite/tests/llvm/should_compile/all.T
@@ -12,4 +12,4 @@ test('T5681', normal, compile, [''])
test('T6158', [reqlib('vector'), reqlib('primitive')], compile, ['-package vector -package primitive'])
test('T7571', cmm_src, compile, [''])
test('T7575', unless(wordsize(32), skip), compile, [''])
-test('T8131', [cmm_src, expect_broken(8131)], compile, [''])
+test('T8131b', [cmm_src], compile, [''])