Commit acf62bd0 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Check flags in OPTIONS_GHC pragma only apply to the module they're in

parent d70bb6d9
{-# OPTIONS_GHC -fwarn-unused-binds #-}
module A (a, a_type_default, a_missing_sig) where
a :: Int
a = 4
a_type_default :: Int
a_type_default = 2 ^ 2
a_missing_sig = ()
{-# OPTIONS_GHC -fwarn-type-defaults #-}
module B (b, b_unused_bind, b_missing_sig) where
b :: Int
b = 5
b_unused_bind :: Int -> Int
b_unused_bind x = 2
b_missing_sig = ()
{-# OPTIONS_GHC -fwarn-missing-signatures #-}
module Main (main, c_type_default, c_unused_bind) where
import A (a)
import B (b)
main :: IO ()
main = print (a + b)
c_type_default :: Int
c_type_default = 2 ^ 2
c_unused_bind :: Int -> Int
c_unused_bind x = 2
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
# Dynamic flags tests
clean:
rm -f *.o *.hi
# 001: Flags turned on in one module's OPTIONS_GHC pragma shouldn't
# be on in when compiling other modules
dynamic_flags_001: clean
$(TEST_HC) --make -Werror -v0 C.hs
test('dynamic_flags_001', skip_if_fast, run_command, ['$MAKE -s --no-print-directory dynamic_flags_001'])
if default_testopts.cleanup != '':
runCmd('$MAKE -s -C ' + in_testdir('') + ' clean')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment