module Main (main) where

import LLVM.ExecutionEngine
          (getTargetData, abiAlignmentOfType,
           storeSizeOfType, intPtrType, littleEndian)
import LLVM.Util.Proxy (Proxy(Proxy))
import LLVM.Core (Vector, unsafeTypeRef, initializeNativeTarget)

import Type.Data.Num.Decimal.Literal (D1, D4)

import Data.Word (Word32, Word64)


main :: IO ()
main = do
    -- Initialize jitter
    initializeNativeTarget

    td <- getTargetData
    print (littleEndian td,
           abiAlignmentOfType td $ unsafeTypeRef (Proxy :: Proxy Word32),
           abiAlignmentOfType td $ unsafeTypeRef (Proxy :: Proxy Word64),
           abiAlignmentOfType td $ unsafeTypeRef (Proxy :: Proxy (Vector D4 Float)),
           abiAlignmentOfType td $ unsafeTypeRef (Proxy :: Proxy (Vector D1 Double)),
           storeSizeOfType td $ unsafeTypeRef (Proxy :: Proxy (Vector D4 Float)),
           intPtrType td
           )
