Skip to content

Commit

Permalink
Add src-loc test for 32 bit pseudo relocation issue
Browse files Browse the repository at this point in the history
See #2228
  • Loading branch information
hamishmack committed Jul 15, 2024
1 parent 0e457c6 commit 9a65377
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ let
plugin = callTest ./plugin {};
supported-languages = callTest ./supported-langauges {};
js-template-haskell = callTest ./js-template-haskell {};
src-loc = callTest ./src-loc { inherit util; };
unit = unitTests;
};

Expand Down
25 changes: 25 additions & 0 deletions test/src-loc/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See https://github.com/input-output-hk/haskell.nix/issues/2228
{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }:

with lib;

let
project = project' {
inherit compiler-nix-name evalPackages;
src = testSrc "src-loc";
};

packages = project.hsPkgs;

in recurseIntoAttrs rec {
meta.disabled = stdenv.hostPlatform.isGhcjs;

ifdInputs = {
inherit (project) plan-nix;
};

build = packages.src-loc.components.exes.src-loc;
check = haskellLib.check build;
build-profiled = packages.src-loc.components.exes.src-loc.profiled;
check-profiled = haskellLib.check build-profiled;
}
13 changes: 13 additions & 0 deletions test/src-loc/src-loc.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cabal-version: >=1.10
name: src-loc
version: 0.1.0.0
license: PublicDomain
author: Hamish Mackenzie
maintainer: Hamish.K.Mackenzie@gmail.com
build-type: Simple

executable src-loc
build-depends: base
main-is: Main.hs
hs-source-dirs: src
default-language: Haskell2010
9 changes: 9 additions & 0 deletions test/src-loc/src/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Main where

import GHC.Types.SrcLoc

main :: IO ()
main = putStrLn "yeah"

data Foo = Foo PsLoc

0 comments on commit 9a65377

Please sign in to comment.