diff --git a/ghc/tests/rename/should_fail/rnfail023.hs b/ghc/tests/rename/should_fail/rnfail023.hs
new file mode 100644
index 0000000000000000000000000000000000000000..bf7c4a2f207527bd47959be2c00dfccb30e1a064
--- /dev/null
+++ b/ghc/tests/rename/should_fail/rnfail023.hs
@@ -0,0 +1,15 @@
+-- !!! Check that type signatures and pragmas that 
+-- !!! don't have a "parent" are correctly reported
+
+module ShouldFail where
+
+-- Top level test
+f :: Int -> Int
+{-# INLINE f #-}
+
+-- Nested test
+h :: Int -> Int	-- This one is ok
+h x = x
+    where
+      g :: Int -> Int	-- Bogus
+
diff --git a/ghc/tests/rename/should_fail/rnfail023.stderr b/ghc/tests/rename/should_fail/rnfail023.stderr
new file mode 100644
index 0000000000000000000000000000000000000000..2725fe6f0b0e88c31b9efaa3fc642eddaeec44c8
--- /dev/null
+++ b/ghc/tests/rename/should_fail/rnfail023.stderr
@@ -0,0 +1,9 @@
+
+rnfail023.hs:7: Variable not in scope: `f'
+
+rnfail023.hs:8: Variable not in scope: `f'
+
+rnfail023.hs:14: Variable not in scope: `g'
+
+Compilation had errors
+