[Git][ghc/ghc][wip/spj-apporv-Oct24] 3 commits: Add regression test for #18177