Commit 2ecdaede authored by tibbe's avatar tibbe
Browse files

Add test for -funbox-strict-primitive-fields

parent f3938cb5
{-# LANGUAGE MagicHash #-}
{-# OPTIONS_GHC -funbox-strict-primitive-fields #-}
module Test where
import GHC.Exts
-- The following should be unboxed automatically:
data A = A Int#
data B = B !A
data C = C !()
data D = D !B
data E = E !D !D
d = D (B (A 0#))
e = E d d
data F = F Int#
newtype G = G F
data H = H !G !G
h = H (G (F 1#)) (G (F 1#))
-- This should not be unboxed:
data I = I !H !H
i = I h h
......@@ -394,3 +394,4 @@ test('holes', normal, compile, ['-fdefer-type-errors'])
test('holes2', normal, compile, ['-fdefer-type-errors'])
test('holes3', normal, compile_fail, [''])
test('T7408', normal, compile, [''])
test('UnboxStrictPrimitiveFields', normal, compile, [''])
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