summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Buhr <buhr@asaurus.net>2019-05-07 11:01:14 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-11 17:46:19 -0400
commitcb5271ac9a6686d065de63d1dde80e713830e21b (patch)
treec21d550a4a1c91ebde978671c599b66122f6d74f
parentd2e290d3280841647354ddf5ca9abdd974bce0d5 (diff)
downloadhaskell-cb5271ac9a6686d065de63d1dde80e713830e21b.tar.gz
Add regression test for old panic on inlining undeclared identifier (#495)
-rw-r--r--testsuite/tests/rename/should_fail/T495.hs7
-rw-r--r--testsuite/tests/rename/should_fail/T495.stderr7
-rw-r--r--testsuite/tests/rename/should_fail/all.T1
3 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_fail/T495.hs b/testsuite/tests/rename/should_fail/T495.hs
new file mode 100644
index 0000000000..7fa871dfdb
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T495.hs
@@ -0,0 +1,7 @@
+-- Regression test for #495
+
+-- inlining an undeclared identifier should give error, not panic...
+{-# INLINE blarg #-}
+
+-- even if the identifier is imported in the Prelude...
+{-# INLINE lookup #-}
diff --git a/testsuite/tests/rename/should_fail/T495.stderr b/testsuite/tests/rename/should_fail/T495.stderr
new file mode 100644
index 0000000000..0581807d70
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T495.stderr
@@ -0,0 +1,7 @@
+
+T495.hs:4:12: error:
+ The INLINE pragma for ‘blarg’ lacks an accompanying binding
+
+T495.hs:7:12: error:
+ The INLINE pragma for ‘lookup’ lacks an accompanying binding
+ (The INLINE pragma must be given where ‘lookup’ is declared)
diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T
index 35a3174000..c36c4cfcf9 100644
--- a/testsuite/tests/rename/should_fail/all.T
+++ b/testsuite/tests/rename/should_fail/all.T
@@ -60,6 +60,7 @@ test('rnfail056', normal, compile_fail, [''])
test('rnfail057', normal, compile_fail, [''])
test('rn_dup', normal, compile_fail, [''])
+test('T495', normal, compile_fail, [''])
test('T2490', normal, compile_fail, [''])
test('T2901', normal, compile_fail, [''])
test('T2723', normal, compile, ['']) # Warnings only