[commit: testsuite] master: Test Trac #6082 rule matching warning (299134c)
Simon Peyton Jones
simonpj at microsoft.com
Mon Jul 23 13:54:58 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/299134c4caed865f04c9a73aa32e24047270040e
>---------------------------------------------------------------
commit 299134c4caed865f04c9a73aa32e24047270040e
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Mon Jul 23 09:23:53 2012 +0100
Test Trac #6082 rule matching warning
>---------------------------------------------------------------
tests/simplCore/should_compile/T6082-RULE.hs | 16 ++++++++++++++++
tests/simplCore/should_compile/T6082-RULE.stderr | 8 ++++++++
tests/simplCore/should_compile/all.T | 1 +
3 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/tests/simplCore/should_compile/T6082-RULE.hs b/tests/simplCore/should_compile/T6082-RULE.hs
new file mode 100644
index 0000000..41881ca
--- /dev/null
+++ b/tests/simplCore/should_compile/T6082-RULE.hs
@@ -0,0 +1,16 @@
+module T6082_RULE where
+
+-- Should warn
+foo1 x = x
+{-# RULES "foo1" forall x. foo1 x = x #-}
+
+-- Should warn
+foo2 x = x
+{-# INLINE foo2 #-}
+{-# RULES "foo2" forall x. foo2 x = x #-}
+
+-- Should not warn
+foo3 x = x
+{-# NOINLINE foo3 #-}
+{-# RULES "foo3" forall x. foo3 x = x #-}
+
diff --git a/tests/simplCore/should_compile/T6082-RULE.stderr b/tests/simplCore/should_compile/T6082-RULE.stderr
new file mode 100644
index 0000000..433c1a4
--- /dev/null
+++ b/tests/simplCore/should_compile/T6082-RULE.stderr
@@ -0,0 +1,8 @@
+
+T6082-RULE.hs:5:11: Warning:
+ Rule "foo1" may never fire becuase `foo1' might inline first
+ Probable fix: add an INLINE[n] or NOINLINE[n] pragma on `foo1'
+
+T6082-RULE.hs:10:11: Warning:
+ Rule "foo2" may never fire becuase `foo2' might inline first
+ Probable fix: add an INLINE[n] or NOINLINE[n] pragma on `foo2'
diff --git a/tests/simplCore/should_compile/all.T b/tests/simplCore/should_compile/all.T
index 38b5730..5805182 100644
--- a/tests/simplCore/should_compile/all.T
+++ b/tests/simplCore/should_compile/all.T
@@ -147,3 +147,4 @@ test('T4138',
extra_clean(['T4138_A.hi', 'T4138_A.o', 'T4138.simpl']),
run_command,
['$MAKE -s --no-print-directory T4138'])
+test('T6082-RULE', normal, compile, [''])
More information about the Cvs-ghc
mailing list