summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/plugins/Makefile5
-rw-r--r--testsuite/tests/plugins/T19926.hs5
-rw-r--r--testsuite/tests/plugins/T19926.stderr5
-rw-r--r--testsuite/tests/plugins/all.T6
-rw-r--r--testsuite/tests/plugins/simple-plugin/Simple/DefaultPlugin.hs5
-rw-r--r--testsuite/tests/plugins/simple-plugin/simple-plugin.cabal1
6 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/plugins/Makefile b/testsuite/tests/plugins/Makefile
index 46ef8cb3eb..2ae8aadae2 100644
--- a/testsuite/tests/plugins/Makefile
+++ b/testsuite/tests/plugins/Makefile
@@ -131,6 +131,11 @@ T16260:
"$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 T16260.hs -package-db simple-plugin/pkg.T16260/local.package.conf -fplugin Simple.TrustworthyPlugin
"$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 T16260.hs -package-db simple-plugin/pkg.T16260/local.package.conf -fplugin Simple.TrustworthyPlugin -fplugin-trustworthy
+.PHONY: T19926
+T19926:
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 T19926.hs -package-db simple-plugin/pkg.T19926/local.package.conf -fplugin Simple.DefaultPlugin
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 T19926.hs -package-db simple-plugin/pkg.T19926/local.package.conf -fplugin Simple.DefaultPlugin -fplugin-trustworthy
+
.PHONY: HoleFitPlugin
HoleFitPlugin:
"$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 HoleFitPlugin.hs -package-db hole-fit-plugin/pkg.hole-fit-plugin/local.package.conf
diff --git a/testsuite/tests/plugins/T19926.hs b/testsuite/tests/plugins/T19926.hs
new file mode 100644
index 0000000000..059611be05
--- /dev/null
+++ b/testsuite/tests/plugins/T19926.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE Trustworthy #-}
+{-# OPTIONS_GHC -Wunsafe #-}
+module T19926 where
+-- Trustworthy module compiled with plugin should warn if -fplugin-trustworthy is not set
diff --git a/testsuite/tests/plugins/T19926.stderr b/testsuite/tests/plugins/T19926.stderr
new file mode 100644
index 0000000000..e943a7ffba
--- /dev/null
+++ b/testsuite/tests/plugins/T19926.stderr
@@ -0,0 +1,5 @@
+
+T19926.hs:3:17: warning: [-Wunsafe]
+ ‘T19926’ has been inferred as unsafe!
+ Reason:
+ <no location info>: warning: Use of plugins makes the module unsafe
diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T
index 12aba63022..7e8dbb52ef 100644
--- a/testsuite/tests/plugins/all.T
+++ b/testsuite/tests/plugins/all.T
@@ -208,6 +208,12 @@ test('T16260',
],
makefile_test, [])
+test('T19926',
+ [extra_files(['simple-plugin/']),
+ pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.T19926 TOP={top}')
+ ],
+ makefile_test, [])
+
test('test-hole-plugin',
[extra_files(['hole-fit-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C hole-fit-plugin package.hole-fit-plugin TOP={top}'),
diff --git a/testsuite/tests/plugins/simple-plugin/Simple/DefaultPlugin.hs b/testsuite/tests/plugins/simple-plugin/Simple/DefaultPlugin.hs
new file mode 100644
index 0000000000..6edf122376
--- /dev/null
+++ b/testsuite/tests/plugins/simple-plugin/Simple/DefaultPlugin.hs
@@ -0,0 +1,5 @@
+module Simple.DefaultPlugin (plugin) where
+import GHC.Driver.Plugins (Plugin, defaultPlugin)
+
+plugin :: Plugin
+plugin = defaultPlugin
diff --git a/testsuite/tests/plugins/simple-plugin/simple-plugin.cabal b/testsuite/tests/plugins/simple-plugin/simple-plugin.cabal
index e6f367100c..af68c5ca3b 100644
--- a/testsuite/tests/plugins/simple-plugin/simple-plugin.cabal
+++ b/testsuite/tests/plugins/simple-plugin/simple-plugin.cabal
@@ -21,3 +21,4 @@ Library
Simple.SourcePlugin
Simple.RemovePlugin
Simple.TrustworthyPlugin
+ Simple.DefaultPlugin