summaryrefslogtreecommitdiff
path: root/testsuite/tests/overloadedrecflds/should_compile
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/overloadedrecflds/should_compile')
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.hs8
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.stderr11
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_B.hs5
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_N.hs5
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_N.hs-boot2
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_O.hs5
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_O.hs-boot4
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/DupFldFixity1.hs9
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/DupFldFixity2.hs12
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/DupFldFixity3.hs9
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/NoDRFModuleExport.hs6
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/NoDRFModuleExport_aux.hs4
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_A.hs5
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_B.hs6
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_C.hs6
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T11103.hs18
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T13352.hs4
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T13352_A.hs2
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T13352_B.hs2
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T13352_hard.hs4
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T13352_hard.stderr9
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T13352_hard_A.hs3
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T13352_hard_B.hs3
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T14848.hs10
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T17551.hs15
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T21720.hs18
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T21898.hs15
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T22160.hs9
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T22160_A.hs3
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T22160_B.hs3
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T22160_C.hs3
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T23010.hs8
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T23010.hs-boot7
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T23010_aux.hs8
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/all.T35
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/overloadedrecflds10.hs7
36 files changed, 283 insertions, 0 deletions
diff --git a/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.hs b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.hs
new file mode 100644
index 0000000000..a0e527f1b3
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.hs
@@ -0,0 +1,8 @@
+module BootFldReexport where
+
+import {-# SOURCE #-} BootFldReexport_N
+ ( fld {- variable -} )
+import BootFldReexport_O
+ ( fld {- record field -} )
+
+test3 = fld
diff --git a/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.stderr b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.stderr
new file mode 100644
index 0000000000..0830beb7fc
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.stderr
@@ -0,0 +1,11 @@
+
+BootFldReexport.hs:8:9: error:
+ Ambiguous occurrence ‘fld’
+ It could refer to
+ either ‘BootFldReexport_N.fld’,
+ imported from ‘BootFldReexport_N’ at BootFldReexport.hs:4:5-7
+ (and originally defined in ‘BootFldReexport_O’
+ at BootFldReexport_O.hs-boot:4:1-13)
+ or the field ‘fld’ of record ‘BootFldReexport_O.O’,
+ imported from ‘BootFldReexport_O’ at BootFldReexport.hs:6:5-7
+ (and originally defined at BootFldReexport_O.hs:5:16-18)
diff --git a/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_B.hs b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_B.hs
new file mode 100644
index 0000000000..8d8024313c
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_B.hs
@@ -0,0 +1,5 @@
+module BootFldReexport_B where
+
+import {-# SOURCE #-} BootFldReexport_N
+
+test2 = fld
diff --git a/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_N.hs b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_N.hs
new file mode 100644
index 0000000000..8a28e3705c
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_N.hs
@@ -0,0 +1,5 @@
+module BootFldReexport_N ( module BootFldReexport_O ) where
+import BootFldReexport_O
+import BootFldReexport
+
+test1 = fld
diff --git a/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_N.hs-boot b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_N.hs-boot
new file mode 100644
index 0000000000..49c9c7c996
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_N.hs-boot
@@ -0,0 +1,2 @@
+module BootFldReexport_N ( module BootFldReexport_O ) where
+import {-# SOURCE #-} BootFldReexport_O \ No newline at end of file
diff --git a/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_O.hs b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_O.hs
new file mode 100644
index 0000000000..733f7e3ed6
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_O.hs
@@ -0,0 +1,5 @@
+module BootFldReexport_O where
+
+import BootFldReexport_B
+
+data O = MkO { fld :: O }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_O.hs-boot b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_O.hs-boot
new file mode 100644
index 0000000000..617ec6fb90
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport_O.hs-boot
@@ -0,0 +1,4 @@
+module BootFldReexport_O where
+
+data O
+fld :: O -> O
diff --git a/testsuite/tests/overloadedrecflds/should_compile/DupFldFixity1.hs b/testsuite/tests/overloadedrecflds/should_compile/DupFldFixity1.hs
new file mode 100644
index 0000000000..58e7afe673
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/DupFldFixity1.hs
@@ -0,0 +1,9 @@
+
+
+{-# LANGUAGE DuplicateRecordFields #-}
+
+module DupFldFixity1 where
+
+data A = MkA { fld :: A -> A }
+
+infixr 4 `fld`
diff --git a/testsuite/tests/overloadedrecflds/should_compile/DupFldFixity2.hs b/testsuite/tests/overloadedrecflds/should_compile/DupFldFixity2.hs
new file mode 100644
index 0000000000..85811c3b0f
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/DupFldFixity2.hs
@@ -0,0 +1,12 @@
+
+{-# LANGUAGE NoFieldSelectors #-}
+
+module DupFldFixity2 where
+
+data A = MkA { fld :: A -> A }
+data B
+
+fld :: B -> B -> B
+fld x _ = x
+
+infixr 4 `fld`
diff --git a/testsuite/tests/overloadedrecflds/should_compile/DupFldFixity3.hs b/testsuite/tests/overloadedrecflds/should_compile/DupFldFixity3.hs
new file mode 100644
index 0000000000..73d8490d57
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/DupFldFixity3.hs
@@ -0,0 +1,9 @@
+
+{-# LANGUAGE DuplicateRecordFields #-}
+
+module DupFldFixity3 where
+
+data A = MkA { fld :: A -> A }
+data B = MkB { fld :: A -> A }
+
+infixr 4 `fld`
diff --git a/testsuite/tests/overloadedrecflds/should_compile/NoDRFModuleExport.hs b/testsuite/tests/overloadedrecflds/should_compile/NoDRFModuleExport.hs
new file mode 100644
index 0000000000..11a21af800
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/NoDRFModuleExport.hs
@@ -0,0 +1,6 @@
+-- Test that we can re-export a module defining
+-- duplicate record fields, without ourselves enabling
+-- the DuplicateRecordFields extension.
+
+module NoDRFModuleExport ( module NoDRFModuleExport_aux ) where
+ import NoDRFModuleExport_aux
diff --git a/testsuite/tests/overloadedrecflds/should_compile/NoDRFModuleExport_aux.hs b/testsuite/tests/overloadedrecflds/should_compile/NoDRFModuleExport_aux.hs
new file mode 100644
index 0000000000..4720fdd547
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/NoDRFModuleExport_aux.hs
@@ -0,0 +1,4 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+module NoDRFModuleExport_aux where
+ data A = MkA { foo :: A }
+ data B = MkB { foo :: B }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_A.hs b/testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_A.hs
new file mode 100644
index 0000000000..ae25153621
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_A.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE TypeFamilies #-}
+module OverloadedRecFlds10_A where
+
+data family F a
+data instance F Int = MkFInt { foo :: Int }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_B.hs b/testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_B.hs
new file mode 100644
index 0000000000..0f7be47880
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_B.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE TypeFamilies #-}
+module OverloadedRecFlds10_B (F(..)) where
+
+import OverloadedRecFlds10_A hiding (foo)
+
+data instance F Bool = MkFBool { foo :: Int }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_C.hs b/testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_C.hs
new file mode 100644
index 0000000000..29c4863334
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/OverloadedRecFlds10_C.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE DuplicateRecordFields, TypeFamilies #-}
+module OverloadedRecFlds10_C (F(..)) where
+
+import OverloadedRecFlds10_A
+
+data instance F Char = MkFChar { foo :: Char }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T11103.hs b/testsuite/tests/overloadedrecflds/should_compile/T11103.hs
new file mode 100644
index 0000000000..6662b29cfa
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T11103.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE DuplicateRecordFields, TemplateHaskell #-}
+
+module T11103 where
+
+import Language.Haskell.TH
+import Language.Haskell.TH.Syntax
+
+data R = MkR { foo :: Int, bar :: Int }
+data S = MkS { foo :: Int }
+
+$(do info <- reify ''R
+ case info of
+ TyConI (DataD _ _ _ _ [RecC _ [(foo_n, _, _), (bar_n, _, _)]] _)
+ -> do { reify bar_n -- This is unambiguous
+ ; reify foo_n -- This is ambiguous
+ ; return []
+ }
+ _ -> error "unexpected result of reify")
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T13352.hs b/testsuite/tests/overloadedrecflds/should_compile/T13352.hs
new file mode 100644
index 0000000000..9d85b725b6
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T13352.hs
@@ -0,0 +1,4 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+module T13352 (S(foo), T(foo)) where
+ import T13352_A (S(..))
+ import T13352_B (T(..))
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T13352_A.hs b/testsuite/tests/overloadedrecflds/should_compile/T13352_A.hs
new file mode 100644
index 0000000000..2639b4bb38
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T13352_A.hs
@@ -0,0 +1,2 @@
+module T13352_A where
+ data S = MkS { foo :: Int }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T13352_B.hs b/testsuite/tests/overloadedrecflds/should_compile/T13352_B.hs
new file mode 100644
index 0000000000..b04cd1168f
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T13352_B.hs
@@ -0,0 +1,2 @@
+module T13352_B where
+ data T = MkT { foo :: Int }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T13352_hard.hs b/testsuite/tests/overloadedrecflds/should_compile/T13352_hard.hs
new file mode 100644
index 0000000000..982305e71d
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T13352_hard.hs
@@ -0,0 +1,4 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+module T13352_hard (S(foo), T(foo)) where
+ import T13352_hard_A (S(..))
+ import T13352_hard_B (T(..))
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T13352_hard.stderr b/testsuite/tests/overloadedrecflds/should_compile/T13352_hard.stderr
new file mode 100644
index 0000000000..bd4bf93121
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T13352_hard.stderr
@@ -0,0 +1,9 @@
+
+T13352_hard.hs:2:29: error: [GHC-69158]
+ Conflicting exports for ‘foo’:
+ ‘S(foo)’ exports ‘T13352_hard_A.foo’
+ imported from ‘T13352_hard_A’ at T13352_hard.hs:3:25-29
+ (and originally defined at T13352_hard_A.hs:3:16-18)
+ ‘T(foo)’ exports ‘T13352_hard_B.foo’
+ imported from ‘T13352_hard_B’ at T13352_hard.hs:4:25-29
+ (and originally defined at T13352_hard_B.hs:3:16-18)
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T13352_hard_A.hs b/testsuite/tests/overloadedrecflds/should_compile/T13352_hard_A.hs
new file mode 100644
index 0000000000..3fcba12280
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T13352_hard_A.hs
@@ -0,0 +1,3 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+module T13352_hard_A where
+ data S = C { foo :: Int }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T13352_hard_B.hs b/testsuite/tests/overloadedrecflds/should_compile/T13352_hard_B.hs
new file mode 100644
index 0000000000..7271dda542
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T13352_hard_B.hs
@@ -0,0 +1,3 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+module T13352_hard_B where
+ data T = C { foo :: Int }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T14848.hs b/testsuite/tests/overloadedrecflds/should_compile/T14848.hs
new file mode 100644
index 0000000000..f19ebbecca
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T14848.hs
@@ -0,0 +1,10 @@
+{-# language TemplateHaskell #-}
+{-# language DuplicateRecordFields #-}
+
+module T14848 where
+import Language.Haskell.TH
+import Language.Haskell.TH.Syntax
+
+data A = A {x :: Int, y :: String}
+a = A 3 "test"
+test = $([e|case a of A {x = b} -> b|])
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T17551.hs b/testsuite/tests/overloadedrecflds/should_compile/T17551.hs
new file mode 100644
index 0000000000..8fe5d9f808
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T17551.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+{-# LANGUAGE TemplateHaskell #-}
+
+module T17551 where
+
+import Language.Haskell.TH
+
+data Foo = Foo { foo :: Int }
+data Bar = Bar { foo :: Int }
+
+$(do
+ TyConI (DataD _ _ _ _ [RecC con [(field, _, _)]] _) <- reify ''Bar
+ reify field
+ pure []
+ )
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T21720.hs b/testsuite/tests/overloadedrecflds/should_compile/T21720.hs
new file mode 100644
index 0000000000..072bde217a
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T21720.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE DuplicateRecordFields #-}
+{-# OPTIONS_GHC -dcore-lint #-}
+
+module T21720 where
+
+import Language.Haskell.TH
+
+main :: IO ()
+main = pure ()
+
+$(do
+ let noBang = Bang NoSourceUnpackedness NoSourceStrictness
+ let mkData tn cn fn = DataD [] tn [] Nothing [RecC cn [(fn, noBang, ConT ''Integer)]] []
+ r1 <- mkData <$> newName "R1" <*> newName "C1" <*> newName "f"
+ r2 <- mkData <$> newName "R2" <*> newName "C2" <*> newName "f"
+ pure [r1,r2]
+ )
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T21898.hs b/testsuite/tests/overloadedrecflds/should_compile/T21898.hs
new file mode 100644
index 0000000000..b7b0b051e8
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T21898.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE DuplicateRecordFields, PatternSynonyms #-}
+
+module T21898 where
+
+pattern P :: Int -> Int -> (Int, Int)
+pattern P { proj_x, proj_y } = (proj_x, proj_y)
+
+pattern Q1 :: Int -> Int
+pattern Q1 { proj_x } = proj_x
+
+pattern Q2 :: Int -> Int
+pattern Q2 { proj_y } = proj_y
+
+blah :: (Int, Int) -> (Int, Int)
+blah p = p { proj_x = 0, proj_y = 1 }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T22160.hs b/testsuite/tests/overloadedrecflds/should_compile/T22160.hs
new file mode 100644
index 0000000000..28aaa3c735
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T22160.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE DisambiguateRecordFields #-}
+
+module T22160 where
+
+import T22160_A
+import T22160_B
+import T22160_C
+
+eg r = r { x = 1, y = 1 }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T22160_A.hs b/testsuite/tests/overloadedrecflds/should_compile/T22160_A.hs
new file mode 100644
index 0000000000..341df010ba
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T22160_A.hs
@@ -0,0 +1,3 @@
+module T22160_A where
+
+data A = MkA { x :: Int }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T22160_B.hs b/testsuite/tests/overloadedrecflds/should_compile/T22160_B.hs
new file mode 100644
index 0000000000..2da5511e6c
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T22160_B.hs
@@ -0,0 +1,3 @@
+module T22160_B where
+
+data B = MkB { y :: Int }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T22160_C.hs b/testsuite/tests/overloadedrecflds/should_compile/T22160_C.hs
new file mode 100644
index 0000000000..450463e0a6
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T22160_C.hs
@@ -0,0 +1,3 @@
+module T22160_C where
+
+data C = MkC { x, y :: Int }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T23010.hs b/testsuite/tests/overloadedrecflds/should_compile/T23010.hs
new file mode 100644
index 0000000000..7ae1ff5f98
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T23010.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+
+module T23010 ( A(..) ) where
+
+import T23010_aux ( X )
+
+data A = MkA { fld :: A, other :: X }
+data B = MkB { fld :: B }
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T23010.hs-boot b/testsuite/tests/overloadedrecflds/should_compile/T23010.hs-boot
new file mode 100644
index 0000000000..ea72bd20f6
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T23010.hs-boot
@@ -0,0 +1,7 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+
+module T23010 where
+
+data A
+
+fld :: A -> A
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T23010_aux.hs b/testsuite/tests/overloadedrecflds/should_compile/T23010_aux.hs
new file mode 100644
index 0000000000..1f1280b26a
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T23010_aux.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+
+module T23010_aux where
+
+import {-# SOURCE #-} T23010 ( fld )
+
+data X
+bar = fld
diff --git a/testsuite/tests/overloadedrecflds/should_compile/all.T b/testsuite/tests/overloadedrecflds/should_compile/all.T
index 9d49752f2b..000fd696e4 100644
--- a/testsuite/tests/overloadedrecflds/should_compile/all.T
+++ b/testsuite/tests/overloadedrecflds/should_compile/all.T
@@ -12,3 +12,38 @@ test('T19154', normal, compile, [''])
test('T20723', normal, compile, [''])
test('T20989', normal, compile, [''])
test('T21625', [], multimod_compile, ['T21625', '-v0'])
+test('DupFldFixity1', normal, compile, [''])
+test('DupFldFixity2', normal, compile, [''])
+test('T23010', [extra_files(['T23010.hs-boot', 'T23010_aux.hs'])]
+ , multimod_compile
+ , ['T23010', '-v0'])
+test('T14848', req_th, compile, [''])
+test('T17551', req_th, compile, [''])
+test('T11103', req_th, compile, [''])
+test('T13352'
+ , [extra_files(['T13352_A.hs', 'T13352_B.hs'])]
+ , multimod_compile, ['T13352_A T13352_B T13352', '-v0'])
+test('T13352_hard'
+ , [extra_files(['T13352_hard_A.hs', 'T13352_hard_B.hs'])]
+ , multimod_compile_fail, ['T13352_hard_A T13352_hard_B T13352_hard', '-v0'])
+test('T21720', req_th, compile, [''])
+test('T21898', normal, compile, [''])
+test('T22160', [extra_files(['T22160_A.hs', 'T22160_B.hs', 'T22160_C.hs'])]
+ , multimod_compile, ['T22160_A T22160_B T22160_C T22160', '-v0'])
+test('DupFldFixity3', normal, compile, [''])
+test('overloadedrecflds10'
+ , [extra_files(['OverloadedRecFlds10_A.hs', 'OverloadedRecFlds10_B.hs', 'OverloadedRecFlds10_C.hs'])]
+ , multimod_compile
+ , ['overloadedrecflds10', '-v0'])
+test('NoDRFModuleExport'
+ , [extra_files(['NoDRFModuleExport_aux.hs'])]
+ , multimod_compile
+ , ['NoDRFModuleExport', '-v0'])
+test('BootFldReexport'
+ , [extra_files([ 'BootFldReexport_N.hs', 'BootFldReexport_N.hs-boot'
+ , 'BootFldReexport_O.hs', 'BootFldReexport_O.hs-boot'
+ , 'BootFldReexport_B.hs' ])]
+ , multimod_compile_fail
+ # Should either pass or give an ambiguity error when compiling
+ # the final module (BootFldReexport), but not fail earlier.
+ , ['BootFldReexport', '-v0'])
diff --git a/testsuite/tests/overloadedrecflds/should_compile/overloadedrecflds10.hs b/testsuite/tests/overloadedrecflds/should_compile/overloadedrecflds10.hs
new file mode 100644
index 0000000000..c85d303d0e
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/overloadedrecflds10.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+module Main (main, F(..)) where
+
+import OverloadedRecFlds10_B
+import OverloadedRecFlds10_C
+
+main = return ()