summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/stranal/should_run/strun002.hs
blob: 145166964d5ff5e8a822679e5c3c10cd4a43abac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
-- This showed up an "entered-absent-arg" error in 5.02.1

module Main where

is_volatile :: [Int] -> (String,Int) -> Int
is_volatile [] (destVarName, destPtr)
	= error ("Variable not found: " ++ "(" ++ (show destPtr) ++ ") " ++ destVarName)
is_volatile (a:allWrites) (destVarName, destPtr)
  | a == destPtr    = a
  | otherwise = is_volatile allWrites (destVarName, destPtr)

main = print (is_volatile [] ("hello",2))