diff --git a/testsuite/tests/perf/compiler/Makefile b/testsuite/tests/perf/compiler/Makefile
index 06f9ac130412c18be4eba702bf7a5ffe28a1b004..667217d5ee55aec99dbfea085de027dc13cc9fb8 100644
--- a/testsuite/tests/perf/compiler/Makefile
+++ b/testsuite/tests/perf/compiler/Makefile
@@ -17,6 +17,12 @@ MultiModulesRecomp:
 	./genMultiLayerModules
 	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 MultiLayerModules.hs
 
+# -e "" exits the ghci session immediately and merely makes sure, we generated interface files
+# containing core expressions, aka `mi_extra_decls` are populated.
+MultiModulesRecompDefsWithCore:
+	./genMultiLayerModulesCore
+	'$(TEST_HC)' --interactive $(TEST_HC_OPTS) -e "" -fwrite-if-simplified-core MultiLayerModules
+
 MultiComponentModulesRecomp:
 	'$(PYTHON)' genMultiComp.py
 	TEST_HC='$(TEST_HC)' TEST_HC_OPTS='$(TEST_HC_OPTS)' ./run
diff --git a/testsuite/tests/perf/compiler/MultiLayerModulesDefsGhciWithCore.script b/testsuite/tests/perf/compiler/MultiLayerModulesDefsGhciWithCore.script
new file mode 100644
index 0000000000000000000000000000000000000000..05db2868354144ffea5cd0d7b0e1ebe5cd307758
--- /dev/null
+++ b/testsuite/tests/perf/compiler/MultiLayerModulesDefsGhciWithCore.script
@@ -0,0 +1 @@
+:m + MultiLayerModules
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index cfef36f9f4364947fa09dab67c1642b22c51cfe2..37becfc2b18c41d4203d066bc3db4eb9c1848819 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -405,6 +405,20 @@ test('MultiLayerModulesDefsGhci',
      ghci_script,
      ['MultiLayerModulesDefsGhci.script'])
 
+test('MultiLayerModulesDefsGhciWithCore',
+     [ collect_compiler_residency(15),
+       pre_cmd('$MAKE -s --no-print-directory MultiModulesRecompDefsWithCore'),
+       extra_files(['genMultiLayerModulesCore', 'MultiLayerModulesDefsGhciWithCore.script']),
+       compile_timeout_multiplier(5),
+       # this is _a lot_
+       # but this test has been failing every now and then,
+       # especially on i386. Let's just give it some room
+       # to complete successfully reliably everywhere.
+       extra_run_opts('-fwrite-if-simplified-core MultiLayerModules')
+     ],
+     ghci_script,
+     ['MultiLayerModulesDefsGhciWithCore.script'])
+
 test('MultiLayerModulesDefsGhciReload',
      [ collect_compiler_residency(15),
        pre_cmd('./genMultiLayerModulesDefs'),
diff --git a/testsuite/tests/perf/compiler/genMultiLayerModulesCore b/testsuite/tests/perf/compiler/genMultiLayerModulesCore
new file mode 100755
index 0000000000000000000000000000000000000000..2c43c1143307fbec2d13353b7f4cf660f98c2518
--- /dev/null
+++ b/testsuite/tests/perf/compiler/genMultiLayerModulesCore
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# Generate $WIDTH modules with one type each $FIELDS type variables.
+# The type has $CONSTRS constructors with each $FIELDS fields.
+# All types derive 'Generic' to generate a large amount of Types.
+# MultiLayerModules.hs imports all the modules
+WIDTH=10
+FIELDS=10
+CONSTRS=15
+FIELD_VARS=$(for field in $(seq -w 1 $FIELDS); do echo -n "a${field} "; done)
+for i in $(seq -w 1 $WIDTH); do
+  echo "module DummyLevel$i where" > DummyLevel$i.hs;
+  echo "import GHC.Generics" >> DummyLevel$i.hs;
+  echo "data Type_${i} ${FIELD_VARS}" >> DummyLevel$i.hs;
+  for constr in $(seq -w 1 $CONSTRS); do
+    if [ $constr -eq 1 ]; then
+      echo -n " = Constr_${i}_${constr} " >> DummyLevel$i.hs;
+    else
+      echo -n " | Constr_${i}_${constr} " >> DummyLevel$i.hs;
+    fi
+    echo ${FIELD_VARS} >> DummyLevel$i.hs;
+  done
+  echo " deriving (Show, Eq, Ord, Generic)"  >> DummyLevel$i.hs;
+done
+
+echo "module MultiLayerModules where" > MultiLayerModules.hs
+for j in $(seq -w 1 $WIDTH); do
+  echo "import DummyLevel$j" >> MultiLayerModules.hs;
+done