# HG changeset patch # User haftmann # Date 1737047251 -3600 # Node ID 1085eb118dc7c5c162eee5ac4a16c854e4e31953 # Parent e31120ed89c9096c6505e9fb6bb32ed8ec4f1fb7 restrict check to PolyML diff -r e31120ed89c9 -r 1085eb118dc7 src/HOL/Codegenerator_Test/Generate_Target_Bit_Operations.thy --- a/src/HOL/Codegenerator_Test/Generate_Target_Bit_Operations.thy Thu Jan 16 10:09:42 2025 +0000 +++ b/src/HOL/Codegenerator_Test/Generate_Target_Bit_Operations.thy Thu Jan 16 18:07:31 2025 +0100 @@ -60,25 +60,24 @@ test_code check in GHC test_code check in Scala -text \Checking the index maximum for \\SML\\ +text \Checking the index maximum for \\PolyML\\ + +definition \check_max = ()\ -ML \ +definition \anchor = (Code_Target_Bit_Shifts.drop_bit, check_max)\ + +code_printing + code_module Check_Max \ + (SML) \ fun check_max max = let val _ = IntInf.~>> (0, max); - val _ = \<^assert> ((IntInf.~>> (0, Word.+ (max, Word.fromInt 1)); false) handle Size => true) + val _ = ((IntInf.~>> (0, Word.+ (max, Word.fromInt 1)); raise Fail "Bad max") handle Size => ()) in () end; \ - -definition \check_max = ()\ - -code_printing constant check \ - (Eval) "check'_max Bit'_Shifts.word'_max'_index" + | constant check_max \ + (SML) "check'_max Bit'_Shifts.word'_max'_index" -definition \anchor = (Code_Target_Bit_Shifts.drop_bit, check_max)\ - -ML \ -\<^code>\anchor\; -\ +test_code \snd anchor = ()\ in PolyML end