From b09e69587d58b129bb6eee9bb42633eb0706e6e6 Mon Sep 17 00:00:00 2001
From: Zubin Duggal <zubin@cmi.ac.in>
Date: Wed, 17 Jan 2024 19:51:53 +0530
Subject: [PATCH] testsuite: Add test for #24327

---
 testsuite/tests/ghci/T24327/T24327.hs     |  6 ++++++
 testsuite/tests/ghci/T24327/T24327.script |  1 +
 testsuite/tests/ghci/T24327/T24327A.hs    | 10 ++++++++++
 testsuite/tests/ghci/T24327/all.T         |  1 +
 4 files changed, 18 insertions(+)
 create mode 100644 testsuite/tests/ghci/T24327/T24327.hs
 create mode 100644 testsuite/tests/ghci/T24327/T24327.script
 create mode 100644 testsuite/tests/ghci/T24327/T24327A.hs
 create mode 100644 testsuite/tests/ghci/T24327/all.T

diff --git a/testsuite/tests/ghci/T24327/T24327.hs b/testsuite/tests/ghci/T24327/T24327.hs
new file mode 100644
index 000000000000..544578ca963c
--- /dev/null
+++ b/testsuite/tests/ghci/T24327/T24327.hs
@@ -0,0 +1,6 @@
+module T24327 where
+import T24327A
+
+bar :: Int
+bar = foo1 'a' 1
+
diff --git a/testsuite/tests/ghci/T24327/T24327.script b/testsuite/tests/ghci/T24327/T24327.script
new file mode 100644
index 000000000000..b0773fb9bbd3
--- /dev/null
+++ b/testsuite/tests/ghci/T24327/T24327.script
@@ -0,0 +1 @@
+:l T24327
diff --git a/testsuite/tests/ghci/T24327/T24327A.hs b/testsuite/tests/ghci/T24327/T24327A.hs
new file mode 100644
index 000000000000..ca57be5eadf0
--- /dev/null
+++ b/testsuite/tests/ghci/T24327/T24327A.hs
@@ -0,0 +1,10 @@
+module T24327A where
+
+{-# INLINE foo1 #-}
+foo1 :: Char -> Int -> Int
+foo1 _  y = bar1 y
+
+{-# INLINE bar1 #-}
+bar1 :: Int -> Int
+bar1 x = length [1..10] + x
+
diff --git a/testsuite/tests/ghci/T24327/all.T b/testsuite/tests/ghci/T24327/all.T
new file mode 100644
index 000000000000..28fa79c10163
--- /dev/null
+++ b/testsuite/tests/ghci/T24327/all.T
@@ -0,0 +1 @@
+test('T24327', [extra_ways(['ghci-ext-prof']), only_ways(['ghci-ext-prof']), extra_files(['T24327A.hs', 'T24327.hs']), extra_hc_opts('-fno-unoptimized-core-for-interpreter -O')], ghci_script, ['T24327.script'])
-- 
GitLab