diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-05-10 12:45:11 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-05-10 12:45:11 +0100 |
commit | b2d98cc32634c05d7c5e2c2baf29a22dcdb8116e (patch) | |
tree | 8099aa5cb6e7a4340ecb43d3da40df81f3ae520b | |
parent | 4faed348ec5ecf899feea4bdcae4a555c118c68b (diff) | |
download | haskell-b2d98cc32634c05d7c5e2c2baf29a22dcdb8116e.tar.gz |
Test Trac #5623
4 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile index 2d77e65464..4dddb2eb21 100644 --- a/testsuite/tests/simplCore/should_compile/Makefile +++ b/testsuite/tests/simplCore/should_compile/Makefile @@ -70,3 +70,8 @@ T5327: $(RM) -f T5327.hi T5327.o '$(TEST_HC)' $(TEST_HC_OPTS) -c T5327.hs -O -ddump-simpl | grep -c "GHC.Prim.># 34 " +.PHONY: T5623 +T5623: + $(RM) -f T5623.hi T5623.o + '$(TEST_HC)' $(TEST_HC_OPTS) -c T5623.hs -O -ddump-prep | grep -c "plusAddr#" + diff --git a/testsuite/tests/simplCore/should_compile/T5623.hs b/testsuite/tests/simplCore/should_compile/T5623.hs new file mode 100644 index 0000000000..1936ff78a3 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T5623.hs @@ -0,0 +1,10 @@ +module T5623 where + +import Foreign.Storable +import Control.Monad +import GHC.Ptr + +foo :: Ptr Float -> IO Float +foo p = liftM2 (+) (peekElemOff q 0) (peekElemOff q 1) + where + q = p `plusPtr` 4 diff --git a/testsuite/tests/simplCore/should_compile/T5623.stdout b/testsuite/tests/simplCore/should_compile/T5623.stdout new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T5623.stdout @@ -0,0 +1 @@ +1 diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 6cfec0b81b..ac9b8f8639 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -134,6 +134,7 @@ test('simpl021', run_command, ['$MAKE -s --no-print-directory simpl021']) test('T5327', normal, run_command, ['$MAKE -s --no-print-directory T5327']) +test('T5623', normal, run_command, ['$MAKE -s --no-print-directory T5623']) test('T5658b', normal, run_command, |