summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_gen_asm/memcpy-unroll.cmm
diff options
context:
space:
mode:
authorJohan Tibell <johan.tibell@gmail.com>2011-05-31 11:56:58 +0200
committerSimon Marlow <marlowsd@gmail.com>2012-10-09 16:36:31 +0100
commit5ec6ea3e8f17f993f6a64e5220e9b31b2e23f8bd (patch)
tree7135a106b5281a159d3e0a9a9fbbb3fdc5230ca5 /testsuite/tests/codeGen/should_gen_asm/memcpy-unroll.cmm
parent5f48b24b303326599147223c64b10b0cfb016a48 (diff)
downloadhaskell-5ec6ea3e8f17f993f6a64e5220e9b31b2e23f8bd.tar.gz
Make it possible to test the generated assembly
This test framework feature is inspired by a similar feature in LLVM. The programmer writes a bit of Cmm #include "Cmm.h" // Large memcpy's should lower to calls. callMemcpy { W_ dst, src; prim %memcpy(dst "ptr", src "ptr", 1024, 4) []; } and asserts what the generated assembly should look like, modulo register naming. callMemcpy: movq ; Move arguments into place movq movl movl call memcpy Patch edited and updated by Simon Marlow, and I also added a test for unrolling memcpy and a simple constant-propagation test.
Diffstat (limited to 'testsuite/tests/codeGen/should_gen_asm/memcpy-unroll.cmm')
-rw-r--r--testsuite/tests/codeGen/should_gen_asm/memcpy-unroll.cmm8
1 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_gen_asm/memcpy-unroll.cmm b/testsuite/tests/codeGen/should_gen_asm/memcpy-unroll.cmm
new file mode 100644
index 0000000000..95656b4410
--- /dev/null
+++ b/testsuite/tests/codeGen/should_gen_asm/memcpy-unroll.cmm
@@ -0,0 +1,8 @@
+#include "Cmm.h"
+
+// Small memcpies should unroll
+callMemcpy (W_ dst, W_ src)
+{
+ prim %memcpy(dst, src, 16, 4);
+ return ();
+}