blob: acb885369c19a15d59d831d35f778eec7a179f95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
{-# LANGUAGE MagicHash #-}
module Main where
import GHC.Prim
import GHC.Int
-- Test that large unchecked shifts, which constitute undefined behavior, do
-- not crash the compiler and instead evaluate to 0.
-- See Note [Guarding against silly shifts] in PrelRules.
-- Shift should be larger than the word size (e.g. 64 on 64-bit) for this test.
main = print (I# (uncheckedIShiftL# 1# 1000#))
|