Test Trac #6082 rule matching warning
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 23 Jul 2012 08:23:53 +0000 (09:23 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Mon, 23 Jul 2012 08:23:53 +0000 (09:23 +0100)
testsuite/tests/simplCore/should_compile/T6082-RULE.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T6082-RULE.stderr [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/all.T

diff --git a/testsuite/tests/simplCore/should_compile/T6082-RULE.hs b/testsuite/tests/simplCore/should_compile/T6082-RULE.hs
new file mode 100644 (file)
index 0000000..41881ca
--- /dev/null
@@ -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/testsuite/tests/simplCore/should_compile/T6082-RULE.stderr b/testsuite/tests/simplCore/should_compile/T6082-RULE.stderr
new file mode 100644 (file)
index 0000000..433c1a4
--- /dev/null
@@ -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'
index 38b5730..5805182 100644 (file)
@@ -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, [''])