Commit c93e8668 authored by ian@well-typed.com's avatar ian@well-typed.com

Add a test for #7835

parent 5970bafb
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
T7835:
$(RM) Test Test.exe Test.hi Test.o TestPrim.hi TestPrim.o test-prims.o
"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make Test test-prims.cmm
./Test
import qualified TestPrim
main = print $ TestPrim.tpo 8 9
{-# LANGUAGE GHCForeignImportPrim #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnliftedFFITypes #-}
{-# LANGUAGE NoImplicitPrelude #-}
module TestPrim
(
tpo#
, tpo
) where
import GHC.Base -- Int and I#
foreign import prim "test_prim_op" tpo# :: Int# -> Int# -> Int#
tpo :: Int -> Int -> Int
tpo (I# a) (I# b) = I# (tpo# a b)
test('T7835',
extra_clean(['Test', 'Test.exe', 'Test.hi', 'Test.o',
'TestPrim.hi', 'TestPrim.o', 'test-prims.o']),
run_command,
['$MAKE -s --no-print-directory T7835'])
#include "Cmm.h"
test_prim_op (W_ int1, W_ int2)
{
W_ r;
r = int1 + int2;
return (r);
}
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