Commit 3deb1387 authored by Daniel Gröber (dxld)'s avatar Daniel Gröber (dxld)
Browse files

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 41230e26 ("Zero out pinned
block alignment slop when profiling") introduced an ASSERT for this but
this test was still violating it.
parent b9fe4cd5
...@@ -35,7 +35,7 @@ foreign import capi unsafe "capi_ctype_001.h g" ...@@ -35,7 +35,7 @@ foreign import capi unsafe "capi_ctype_001.h g"
instance Storable Foo where instance Storable Foo where
sizeOf _ = #size Foo sizeOf _ = #size Foo
alignment = sizeOf alignment _ = #alignment Foo
peek p = do i <- (# peek Foo, i) p peek p = do i <- (# peek Foo, i) p
j <- (# peek Foo, j) p j <- (# peek Foo, j) p
k <- (# peek Foo, k) p k <- (# peek Foo, k) p
......
...@@ -16,7 +16,7 @@ data FooA = FooA { ...@@ -16,7 +16,7 @@ data FooA = FooA {
instance Storable FooA where instance Storable FooA where
sizeOf _ = #size Foo sizeOf _ = #size Foo
alignment = sizeOf alignment _ = #alignment Foo
peek p = do i <- (# peek Foo, i) p peek p = do i <- (# peek Foo, i) p
j <- (# peek Foo, j) p j <- (# peek Foo, j) p
k <- (# peek Foo, k) p k <- (# peek Foo, k) p
......
...@@ -17,7 +17,7 @@ data {-# CTYPE "capi_ctype_002_A.h" "Foo" #-} ...@@ -17,7 +17,7 @@ data {-# CTYPE "capi_ctype_002_A.h" "Foo" #-}
instance Storable Foo where instance Storable Foo where
sizeOf _ = #size Foo sizeOf _ = #size Foo
alignment = sizeOf alignment _ = #alignment Foo
peek p = do i <- (# peek Foo, i) p peek p = do i <- (# peek Foo, i) p
j <- (# peek Foo, j) p j <- (# peek Foo, j) p
k <- (# peek Foo, k) p k <- (# peek Foo, k) p
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment