diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2020-04-18 14:21:55 +0200 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2021-02-14 22:30:19 +0100 |
commit | 3deb13879694511fcd18277e3d3eeec2afb1a20d (patch) | |
tree | 06472da4b050e9637386913d97c1764fbd5ac6db /testsuite/tests/ffi | |
parent | b9fe4cd5ea843e95a333520e2e6036dd83852f5e (diff) | |
download | haskell-3deb13879694511fcd18277e3d3eeec2afb1a20d.tar.gz |
Fix non power-of-two Storable.alignment in Capi_Ctype tests
Alignments passed to alloca and friends must be a power of two for the code
in allocatePinned to work properly. Commit 41230e2601 ("Zero out pinned
block alignment slop when profiling") introduced an ASSERT for this but
this test was still violating it.
Diffstat (limited to 'testsuite/tests/ffi')
-rw-r--r-- | testsuite/tests/ffi/should_run/Capi_Ctype_001.hsc | 2 | ||||
-rw-r--r-- | testsuite/tests/ffi/should_run/Capi_Ctype_A_001.hsc | 2 | ||||
-rw-r--r-- | testsuite/tests/ffi/should_run/Capi_Ctype_A_002.hsc | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/testsuite/tests/ffi/should_run/Capi_Ctype_001.hsc b/testsuite/tests/ffi/should_run/Capi_Ctype_001.hsc index 5dd24c3183..53341d1d01 100644 --- a/testsuite/tests/ffi/should_run/Capi_Ctype_001.hsc +++ b/testsuite/tests/ffi/should_run/Capi_Ctype_001.hsc @@ -35,7 +35,7 @@ foreign import capi unsafe "capi_ctype_001.h g" instance Storable Foo where sizeOf _ = #size Foo - alignment = sizeOf + alignment _ = #alignment Foo peek p = do i <- (# peek Foo, i) p j <- (# peek Foo, j) p k <- (# peek Foo, k) p diff --git a/testsuite/tests/ffi/should_run/Capi_Ctype_A_001.hsc b/testsuite/tests/ffi/should_run/Capi_Ctype_A_001.hsc index 8b68942db1..3c4b53c40c 100644 --- a/testsuite/tests/ffi/should_run/Capi_Ctype_A_001.hsc +++ b/testsuite/tests/ffi/should_run/Capi_Ctype_A_001.hsc @@ -16,7 +16,7 @@ data FooA = FooA { instance Storable FooA where sizeOf _ = #size Foo - alignment = sizeOf + alignment _ = #alignment Foo peek p = do i <- (# peek Foo, i) p j <- (# peek Foo, j) p k <- (# peek Foo, k) p diff --git a/testsuite/tests/ffi/should_run/Capi_Ctype_A_002.hsc b/testsuite/tests/ffi/should_run/Capi_Ctype_A_002.hsc index 14da1144b6..ad9ec9b6bd 100644 --- a/testsuite/tests/ffi/should_run/Capi_Ctype_A_002.hsc +++ b/testsuite/tests/ffi/should_run/Capi_Ctype_A_002.hsc @@ -17,7 +17,7 @@ data {-# CTYPE "capi_ctype_002_A.h" "Foo" #-} instance Storable Foo where sizeOf _ = #size Foo - alignment = sizeOf + alignment _ = #alignment Foo peek p = do i <- (# peek Foo, i) p j <- (# peek Foo, j) p k <- (# peek Foo, k) p |