Skip to content

Commit 9a65377

Browse files
committed
Add src-loc test for 32 bit pseudo relocation issue
See #2228
1 parent 0e457c6 commit 9a65377

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

test/default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ let
233233
plugin = callTest ./plugin {};
234234
supported-languages = callTest ./supported-langauges {};
235235
js-template-haskell = callTest ./js-template-haskell {};
236+
src-loc = callTest ./src-loc { inherit util; };
236237
unit = unitTests;
237238
};
238239

test/src-loc/default.nix

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# See https://github.com./input-output-hk/haskell.nix/issues/2228
2+
{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }:
3+
4+
with lib;
5+
6+
let
7+
project = project' {
8+
inherit compiler-nix-name evalPackages;
9+
src = testSrc "src-loc";
10+
};
11+
12+
packages = project.hsPkgs;
13+
14+
in recurseIntoAttrs rec {
15+
meta.disabled = stdenv.hostPlatform.isGhcjs;
16+
17+
ifdInputs = {
18+
inherit (project) plan-nix;
19+
};
20+
21+
build = packages.src-loc.components.exes.src-loc;
22+
check = haskellLib.check build;
23+
build-profiled = packages.src-loc.components.exes.src-loc.profiled;
24+
check-profiled = haskellLib.check build-profiled;
25+
}

test/src-loc/src-loc.cabal

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cabal-version: >=1.10
2+
name: src-loc
3+
version: 0.1.0.0
4+
license: PublicDomain
5+
author: Hamish Mackenzie
6+
maintainer: [email protected]
7+
build-type: Simple
8+
9+
executable src-loc
10+
build-depends: base
11+
main-is: Main.hs
12+
hs-source-dirs: src
13+
default-language: Haskell2010

test/src-loc/src/Main.hs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module Main where
2+
3+
import GHC.Types.SrcLoc
4+
5+
main :: IO ()
6+
main = putStrLn "yeah"
7+
8+
data Foo = Foo PsLoc
9+

0 commit comments

Comments
 (0)