hs-bindgen-1.0.0.0: test-artefacts/fixtures/program-analysis/program_slicing_simple/th.txt
-- addDependentFile musl-include/x86_64/bits/alltypes.h
-- addDependentFile musl-include/x86_64/bits/stdint.h
-- addDependentFile musl-include/x86_64/stdint.h
-- addDependentFile test-artefacts/headers/golden/program-analysis/program_slicing_simple.h
-- #include <program-analysis/program_slicing_simple.h>
-- signed int hs_bindgen_48dbbf4b09b5b3c1 (
-- uint64_t arg1,
-- uint32_t arg2
-- )
-- {
-- return (bar)(arg1, arg2);
-- }
-- signed int hs_bindgen_fe855d53295ba8ab (
-- uint64_t arg1,
-- uint32_t arg2
-- )
-- {
-- return (bar)(arg1, arg2);
-- }
-- /* test_programanalysisprogram_slici_Example_get_bar */
-- __attribute__ ((const))
-- signed int (*hs_bindgen_993162e0dadfa2c9 (void)) (
-- uint64_t arg1,
-- uint32_t arg2
-- )
-- {
-- return &bar;
-- }
{-| __C declaration:__ @uint32_t@
__defined at:__ @bits\/alltypes.h 131:25@
__exported by:__ @program-analysis\/program_slicing_simple.h@
-}
newtype Uint32_t
= Uint32_t {unwrapUint32_t :: CUInt}
deriving stock (Eq, Generic, Ord, Read, Show)
deriving newtype (Bitfield,
Bits,
Bounded,
Enum,
FiniteBits,
HasFFIType,
Integral,
Ix,
Num,
Prim,
ReadRaw,
Real,
StaticSize,
Storable,
WriteRaw)
instance (~) ty CUInt => HasField "unwrapUint32_t" Uint32_t ty
where hasField = \x_0 -> (\y_1 -> Uint32_t{unwrapUint32_t = y_1},
getField @"unwrapUint32_t" x_0)
instance (~) ty CUInt =>
HasField "unwrapUint32_t" (Ptr Uint32_t) (Ptr ty)
where getField = fromPtr (Proxy @"unwrapUint32_t")
instance HasCField Uint32_t "unwrapUint32_t"
where type CFieldType Uint32_t "unwrapUint32_t" = CUInt
offset# = \_ -> \_ -> 0
{-| __C declaration:__ @struct foo@
__defined at:__ @program-analysis\/program_slicing_simple.h 3:8@
__exported by:__ @program-analysis\/program_slicing_simple.h@
-}
data Foo
= Foo {foo_sixty_four :: Foreign.C.Types.CULong
{- ^ __C declaration:__ @sixty_four@
__defined at:__ @program-analysis\/program_slicing_simple.h 4:12@
__exported by:__ @program-analysis\/program_slicing_simple.h@
-},
foo_thirty_two :: Uint32_t
{- ^ __C declaration:__ @thirty_two@
__defined at:__ @program-analysis\/program_slicing_simple.h 5:12@
__exported by:__ @program-analysis\/program_slicing_simple.h@
-}}
deriving stock (Eq, Generic, Show)
instance Storable Foo
where sizeOf = \_ -> 16 :: Int
alignment = \_ -> 8 :: Int
peek = \ptr_0 -> (pure Foo <*> peek (Proxy @"foo_sixty_four") ptr_0) <*> peek (Proxy @"foo_thirty_two") ptr_0
poke = \ptr_1 -> \s_2 -> case s_2 of
Foo foo_sixty_four_3
foo_thirty_two_4 -> poke (Proxy @"foo_sixty_four") ptr_1 foo_sixty_four_3 >> poke (Proxy @"foo_thirty_two") ptr_1 foo_thirty_two_4
instance (~) ty Foreign.C.Types.CULong =>
HasField "foo_sixty_four" Foo ty
where hasField = \x_0 -> (\y_1 -> Foo{foo_sixty_four = y_1,
foo_thirty_two = getField @"foo_thirty_two" x_0},
getField @"foo_sixty_four" x_0)
instance (~) ty Foreign.C.Types.CULong =>
HasField "foo_sixty_four" (Ptr Foo) (Ptr ty)
where getField = fromPtr (Proxy @"foo_sixty_four")
instance HasCField Foo "foo_sixty_four"
where type CFieldType Foo "foo_sixty_four" = Foreign.C.Types.CULong
offset# = \_ -> \_ -> 0
instance (~) ty Uint32_t => HasField "foo_thirty_two" Foo ty
where hasField = \x_0 -> (\y_1 -> Foo{foo_thirty_two = y_1,
foo_sixty_four = getField @"foo_sixty_four" x_0},
getField @"foo_thirty_two" x_0)
instance (~) ty Uint32_t =>
HasField "foo_thirty_two" (Ptr Foo) (Ptr ty)
where getField = fromPtr (Proxy @"foo_thirty_two")
instance HasCField Foo "foo_thirty_two"
where type CFieldType Foo "foo_thirty_two" = Uint32_t
offset# = \_ -> \_ -> 8
-- __unique:__ @test_programanalysisprogram_slici_Example_Safe_bar@
foreign import ccall safe "hs_bindgen_48dbbf4b09b5b3c1" hs_bindgen_48dbbf4b09b5b3c1_base ::
CULong
-> CUInt
-> IO CInt
-- __unique:__ @test_programanalysisprogram_slici_Example_Safe_bar@
hs_bindgen_48dbbf4b09b5b3c1 :: Foreign.C.Types.CULong ->
Uint32_t -> IO CInt
-- __unique:__ @test_programanalysisprogram_slici_Example_Safe_bar@
hs_bindgen_48dbbf4b09b5b3c1 = \x_0 -> \x_1 -> fmap fromFFIType (hs_bindgen_48dbbf4b09b5b3c1_base (toFFIType x_0) (toFFIType x_1))
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program_slicing_simple.h 8:5@
__exported by:__ @program-analysis\/program_slicing_simple.h@
-}
bar_safe :: Foreign.C.Types.CULong -> Uint32_t -> IO CInt
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program_slicing_simple.h 8:5@
__exported by:__ @program-analysis\/program_slicing_simple.h@
-}
bar_safe = hs_bindgen_48dbbf4b09b5b3c1
-- __unique:__ @test_programanalysisprogram_slici_Example_Unsafe_bar@
foreign import ccall unsafe "hs_bindgen_fe855d53295ba8ab" hs_bindgen_fe855d53295ba8ab_base ::
CULong
-> CUInt
-> IO CInt
-- __unique:__ @test_programanalysisprogram_slici_Example_Unsafe_bar@
hs_bindgen_fe855d53295ba8ab :: Foreign.C.Types.CULong ->
Uint32_t -> IO CInt
-- __unique:__ @test_programanalysisprogram_slici_Example_Unsafe_bar@
hs_bindgen_fe855d53295ba8ab = \x_0 -> \x_1 -> fmap fromFFIType (hs_bindgen_fe855d53295ba8ab_base (toFFIType x_0) (toFFIType x_1))
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program_slicing_simple.h 8:5@
__exported by:__ @program-analysis\/program_slicing_simple.h@
-}
bar_unsafe :: Foreign.C.Types.CULong -> Uint32_t -> IO CInt
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program_slicing_simple.h 8:5@
__exported by:__ @program-analysis\/program_slicing_simple.h@
-}
bar_unsafe = hs_bindgen_fe855d53295ba8ab
-- __unique:__ @test_programanalysisprogram_slici_Example_get_bar@
foreign import ccall unsafe "hs_bindgen_993162e0dadfa2c9" hs_bindgen_993162e0dadfa2c9_base ::
IO (FunPtr Void)
-- __unique:__ @test_programanalysisprogram_slici_Example_get_bar@
hs_bindgen_993162e0dadfa2c9 :: IO (FunPtr (Foreign.C.Types.CULong ->
Uint32_t -> IO CInt))
-- __unique:__ @test_programanalysisprogram_slici_Example_get_bar@
hs_bindgen_993162e0dadfa2c9 = fmap fromFFIType hs_bindgen_993162e0dadfa2c9_base
{-# NOINLINE bar_funptr #-}
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program_slicing_simple.h 8:5@
__exported by:__ @program-analysis\/program_slicing_simple.h@
-}
bar_funptr :: FunPtr (Foreign.C.Types.CULong ->
Uint32_t -> IO CInt)
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program_slicing_simple.h 8:5@
__exported by:__ @program-analysis\/program_slicing_simple.h@
-}
bar_funptr = unsafePerformIO hs_bindgen_993162e0dadfa2c9