diff --git a/expected_results.json b/expected_results.json index 1d0b737b..f81229fa 100644 --- a/expected_results.json +++ b/expected_results.json @@ -1 +1 @@ -{"chapter_6/valid/rh_assignment.c": {"return_code": 1}, "chapter_6/valid/if_nested_2.c": {"return_code": 2}, "chapter_6/valid/if_nested_3.c": {"return_code": 3}, "chapter_6/valid/nested_ternary.c": {"return_code": 7}, "chapter_6/valid/binary_false_condition.c": {"return_code": 0}, "chapter_6/valid/else.c": {"return_code": 2}, "chapter_6/valid/nested_ternary_2.c": {"return_code": 15}, "chapter_6/valid/ternary_short_circuit.c": {"return_code": 1}, "chapter_6/valid/multiple_if.c": {"return_code": 8}, "chapter_6/valid/if_null_body.c": {"return_code": 1}, "chapter_6/valid/ternary_rh_binop.c": {"return_code": 1}, "chapter_6/valid/ternary_middle_assignment.c": {"return_code": 2}, "chapter_6/valid/if_nested_4.c": {"return_code": 4}, "chapter_6/valid/ternary_middle_binop.c": {"return_code": 1}, "chapter_6/valid/if_taken.c": {"return_code": 1}, "chapter_6/valid/if_not_taken.c": {"return_code": 0}, "chapter_6/valid/if_nested_5.c": {"return_code": 1}, "chapter_6/valid/assign_ternary.c": {"return_code": 2}, "chapter_6/valid/ternary.c": {"return_code": 4}, "chapter_6/valid/if_nested.c": {"return_code": 1}, "chapter_6/valid/ternary_short_circuit_2.c": {"return_code": 2}, "chapter_6/valid/binary_condition.c": {"return_code": 5}, "chapter_6/valid/extra_credit/goto_label_and_var.c": {"return_code": 5}, "chapter_6/valid/extra_credit/goto_label_main_2.c": {"return_code": 0}, "chapter_6/valid/extra_credit/bitwise_ternary.c": {"return_code": 5}, "chapter_6/valid/extra_credit/goto_label_main.c": {"return_code": 0}, "chapter_6/valid/extra_credit/goto_nested_label.c": {"return_code": 5}, "chapter_6/valid/extra_credit/goto_backwards.c": {"return_code": 5}, "chapter_6/valid/extra_credit/goto_label.c": {"return_code": 1}, "chapter_6/valid/extra_credit/compound_if_expression.c": {"return_code": 1}, "chapter_6/valid/extra_credit/goto_after_declaration.c": {"return_code": 1}, "chapter_8/valid/for.c": {"return_code": 16}, "chapter_8/valid/continue.c": {"return_code": 1}, "chapter_8/valid/multi_continue_same_loop.c": {"return_code": 1}, "chapter_8/valid/for_absent_post.c": {"return_code": 0}, "chapter_8/valid/null_for_header.c": {"return_code": 4}, "chapter_8/valid/nested_loop.c": {"return_code": 1}, "chapter_8/valid/nested_break.c": {"return_code": 250}, "chapter_8/valid/do_while.c": {"return_code": 16}, "chapter_8/valid/for_absent_condition.c": {"return_code": 0}, "chapter_8/valid/do_while_break_immediate.c": {"return_code": 10}, "chapter_8/valid/continue_empty_post.c": {"return_code": 30}, "chapter_8/valid/nested_continue.c": {"return_code": 24}, "chapter_8/valid/break.c": {"return_code": 1}, "chapter_8/valid/for_nested_shadow.c": {"return_code": 1}, "chapter_8/valid/empty_expression.c": {"return_code": 0}, "chapter_8/valid/multi_break.c": {"return_code": 1}, "chapter_8/valid/for_decl.c": {"return_code": 101}, "chapter_8/valid/for_shadow.c": {"return_code": 1}, "chapter_8/valid/break_immediate.c": {"return_code": 1}, "chapter_8/valid/while.c": {"return_code": 6}, "chapter_8/valid/empty_loop_body.c": {"return_code": 252}, "chapter_8/valid/extra_credit/switch_fallthrough.c": {"return_code": 4}, "chapter_8/valid/extra_credit/compound_assignment_for_loop.c": {"return_code": 10}, "chapter_8/valid/extra_credit/switch_break.c": {"return_code": 5}, "chapter_8/valid/extra_credit/switch_default.c": {"return_code": 22}, "chapter_8/valid/extra_credit/switch_default_fallthrough.c": {"return_code": 0}, "chapter_8/valid/extra_credit/switch_with_loop.c": {"return_code": 123}, "chapter_8/valid/extra_credit/switch_assign_in_body.c": {"return_code": 3}, "chapter_8/valid/extra_credit/switch_in_loop.c": {"return_code": 1}, "chapter_8/valid/extra_credit/switch_no_case.c": {"return_code": 4}, "chapter_8/valid/extra_credit/switch_nested_case.c": {"return_code": 3}, "chapter_8/valid/extra_credit/switch_nested_not_taken.c": {"return_code": 2}, "chapter_8/valid/extra_credit/switch_decl.c": {"return_code": 7}, "chapter_8/valid/extra_credit/switch_with_continue.c": {"return_code": 5}, "chapter_8/valid/extra_credit/switch_empty.c": {"return_code": 10}, "chapter_8/valid/extra_credit/goto_loop_body.c": {"return_code": 1}, "chapter_8/valid/extra_credit/goto_bypass_condition.c": {"return_code": 10}, "chapter_8/valid/extra_credit/switch_nested_switch.c": {"return_code": 1}, "chapter_8/valid/extra_credit/switch_block.c": {"return_code": 1}, "chapter_8/valid/extra_credit/switch_default_not_last.c": {"return_code": 0}, "chapter_8/valid/extra_credit/switch_assign_in_condition.c": {"return_code": 2}, "chapter_8/valid/extra_credit/switch.c": {"return_code": 3}, "chapter_8/valid/extra_credit/switch_goto_mid_case.c": {"return_code": 1}, "chapter_14/valid/libraries/static_pointer.c": {"return_code": 0}, "chapter_14/valid/libraries/global_pointer.c": {"return_code": 1}, "chapter_14/valid/function_calls/address_of_argument.c": {"return_code": 0}, "chapter_14/valid/function_calls/update_value_through_pointer_parameter.c": {"return_code": 0}, "chapter_14/valid/function_calls/return_pointer.c": {"return_code": 0}, "chapter_14/valid/extra_credit/incr_through_pointer.c": {"return_code": 11}, "chapter_14/valid/extra_credit/compound_assign_through_pointer.c": {"return_code": 1}, "chapter_14/valid/declarators/declare_pointer_in_for_loop.c": {"return_code": 5}, "chapter_14/valid/declarators/abstract_declarators.c": {"return_code": 0}, "chapter_14/valid/declarators/declarators.c": {"return_code": 0}, "chapter_14/valid/dereference/static_var_indirection.c": {"return_code": 0}, "chapter_14/valid/dereference/multilevel_indirection.c": {"return_code": 0}, "chapter_14/valid/dereference/read_through_pointers.c": {"return_code": 0}, "chapter_14/valid/dereference/update_through_pointers.c": {"return_code": 0}, "chapter_14/valid/dereference/address_of_dereference.c": {"return_code": 0}, "chapter_14/valid/dereference/simple.c": {"return_code": 3}, "chapter_14/valid/dereference/dereference_expression_result.c": {"return_code": 0}, "chapter_14/valid/casts/cast_between_pointer_types.c": {"return_code": 0}, "chapter_14/valid/casts/pointer_int_casts.c": {"return_code": 0}, "chapter_14/valid/casts/null_pointer_conversion.c": {"return_code": 0}, "chapter_14/valid/comparisons/compare_pointers.c": {"return_code": 0}, "chapter_14/valid/comparisons/pointers_as_conditions.c": {"return_code": 0}, "chapter_14/valid/comparisons/compare_to_null.c": {"return_code": 0}, "chapter_10/valid/static_then_extern.c": {"return_code": 3}, "chapter_10/valid/push_arg_on_page_boundary.c": {"return_code": 1}, "chapter_10/valid/static_local_multiple_scopes.c": {"return_code": 0, "stdout": "Aa\nBb\nCc\nDd\nEe\nFf\nGg\nHh\nIi\nJj\nKk\nLl\nMm\nNn\nOo\nPp\nQq\nRr\nSs\nTt\nUu\nVv\nWw\nXx\nYy\nZz\n"}, "chapter_10/valid/tentative_definition.c": {"return_code": 5}, "chapter_10/valid/static_variables_in_expressions.c": {"return_code": 0}, "chapter_10/valid/static_recursive_call.c": {"return_code": 0, "stdout": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"}, "chapter_10/valid/shadow_static_local_var.c": {"return_code": 0}, "chapter_10/valid/multiple_static_local.c": {"return_code": 29}, "chapter_10/valid/multiple_static_file_scope_vars.c": {"return_code": 4}, "chapter_10/valid/static_local_uninitialized.c": {"return_code": 4}, "chapter_10/valid/type_before_storage_class.c": {"return_code": 7}, "chapter_10/valid/extern_block_scope_variable.c": {"return_code": 3}, "chapter_10/valid/distinct_local_and_extern.c": {"return_code": 7}, "chapter_10/valid/libraries/internal_hides_external_linkage.c": {"return_code": 0}, "chapter_10/valid/libraries/external_tentative_var.c": {"return_code": 0}, "chapter_10/valid/libraries/external_linkage_function.c": {"return_code": 0}, "chapter_10/valid/libraries/external_variable.c": {"return_code": 0}, "chapter_10/valid/libraries/internal_linkage_var.c": {"return_code": 0}, "chapter_10/valid/libraries/external_var_scoping.c": {"return_code": 0}, "chapter_10/valid/libraries/internal_linkage_function.c": {"return_code": 0}, "chapter_10/valid/extra_credit/goto_skip_static_initializer.c": {"return_code": 10}, "chapter_2/valid/neg.c": {"return_code": 251}, "chapter_2/valid/negate_int_max.c": {"return_code": 1}, "chapter_2/valid/redundant_parens.c": {"return_code": 246}, "chapter_2/valid/neg_zero.c": {"return_code": 0}, "chapter_2/valid/bitwise_int_min.c": {"return_code": 254}, "chapter_2/valid/bitwise_zero.c": {"return_code": 255}, "chapter_2/valid/parens_3.c": {"return_code": 4}, "chapter_2/valid/parens_2.c": {"return_code": 253}, "chapter_2/valid/bitwise.c": {"return_code": 243}, "chapter_2/valid/nested_ops_2.c": {"return_code": 1}, "chapter_2/valid/nested_ops.c": {"return_code": 2}, "chapter_2/valid/parens.c": {"return_code": 254}, "chapter_1/valid/return_0.c": {"return_code": 0}, "chapter_1/valid/newlines.c": {"return_code": 0}, "chapter_1/valid/return_2.c": {"return_code": 2}, "chapter_1/valid/multi_digit.c": {"return_code": 100}, "chapter_1/valid/tabs.c": {"return_code": 0}, "chapter_1/valid/spaces.c": {"return_code": 0}, "chapter_1/valid/no_newlines.c": {"return_code": 0}, "chapter_13/valid/floating_expressions/logical.c": {"return_code": 0}, "chapter_13/valid/floating_expressions/arithmetic_ops.c": {"return_code": 0}, "chapter_13/valid/floating_expressions/static_initialized_double.c": {"return_code": 0}, "chapter_13/valid/floating_expressions/comparisons.c": {"return_code": 0}, "chapter_13/valid/floating_expressions/simple.c": {"return_code": 1}, "chapter_13/valid/floating_expressions/loop_controlling_expression.c": {"return_code": 100}, "chapter_13/valid/libraries/double_parameters.c": {"return_code": 0}, "chapter_13/valid/libraries/use_arg_after_fun_call.c": {"return_code": 4}, "chapter_13/valid/libraries/double_and_int_params_recursive.c": {"return_code": 0}, "chapter_13/valid/libraries/extern_double.c": {"return_code": 1}, "chapter_13/valid/libraries/double_params_and_result.c": {"return_code": 1}, "chapter_13/valid/explicit_casts/cvttsd2i_rewrite.c": {"return_code": 0}, "chapter_13/valid/explicit_casts/double_to_signed.c": {"return_code": 0}, "chapter_13/valid/explicit_casts/unsigned_to_double.c": {"return_code": 0}, "chapter_13/valid/explicit_casts/signed_to_double.c": {"return_code": 0}, "chapter_13/valid/explicit_casts/double_to_unsigned.c": {"return_code": 0}, "chapter_13/valid/implicit_casts/convert_for_assignment.c": {"return_code": 0}, "chapter_13/valid/implicit_casts/common_type.c": {"return_code": 0}, "chapter_13/valid/implicit_casts/static_initializers.c": {"return_code": 0}, "chapter_13/valid/implicit_casts/complex_arithmetic_common_type.c": {"return_code": 1}, "chapter_13/valid/constants/round_constants.c": {"return_code": 0}, "chapter_13/valid/constants/constant_doubles.c": {"return_code": 0}, "chapter_13/valid/special_values/subnormal_not_zero.c": {"return_code": 0}, "chapter_13/valid/special_values/negative_zero.c": {"return_code": 0}, "chapter_13/valid/special_values/infinity.c": {"return_code": 0}, "chapter_13/valid/function_calls/double_parameters.c": {"return_code": 0}, "chapter_13/valid/function_calls/double_and_int_parameters.c": {"return_code": 0}, "chapter_13/valid/function_calls/standard_library_call.c": {"return_code": 0}, "chapter_13/valid/function_calls/use_arg_after_fun_call.c": {"return_code": 4}, "chapter_13/valid/function_calls/return_double.c": {"return_code": 1}, "chapter_13/valid/function_calls/double_and_int_params_recursive.c": {"return_code": 0}, "chapter_13/valid/extra_credit/compound_assign.c": {"return_code": 1}, "chapter_13/valid/extra_credit/nan.c": {"return_code": 0}, "chapter_13/valid/extra_credit/compound_assign_implicit_cast.c": {"return_code": 1}, "chapter_18/valid/params_and_returns/pass_and_return_struct.c": {"return_code": 11}, "chapter_18/valid/params_and_returns/temporary_lifetime.c": {"return_code": 1}, "chapter_18/valid/params_and_returns/return_struct_on_page_boundary.c": {"return_code": 0}, "chapter_18/valid/params_and_returns/return_incomplete_type.c": {"return_code": 1}, "chapter_18/valid/params_and_returns/cast_struct_to_void.c": {"return_code": 2}, "chapter_18/valid/params_and_returns/return_struct.c": {"return_code": 11}, "chapter_18/valid/params_and_returns/libraries/return_calling_conventions.c": {"return_code": 0}, "chapter_18/valid/params_and_returns/libraries/pass_wonky_struct.c": {"return_code": 0}, "chapter_18/valid/params_and_returns/libraries/missing_retval.c": {"return_code": 1}, "chapter_18/valid/params_and_returns/libraries/retval_struct_sizes.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/pass_pointer_to_struct.c": {"return_code": 112}, "chapter_18/valid/no_structure_parameters/typecheck/deref_incomplete_var.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/typecheck/conditional_struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/typecheck/block_scope_forward_decl.c": {"return_code": 3}, "chapter_18/valid/no_structure_parameters/typecheck/define_then_declare.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/typecheck/incomplete_var_completed.c": {"return_code": 100}, "chapter_18/valid/no_structure_parameters/typecheck/file_scope_forward_decl.c": {"return_code": 2}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/copy_struct_with_array_2.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/load_test.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/copy_struct_into_member.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/copy_struct.c": {"return_code": 7}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/array_of_structs_padding.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/array_of_structs.c": {"return_code": 19}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/copy_from_offset_test.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/copy_struct_with_array.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/global_struct.c": {"return_code": 7}, "chapter_18/valid/no_structure_parameters/member_access_tests/deref_arrow.c": {"return_code": 3}, "chapter_18/valid/no_structure_parameters/member_access_tests/linked_list.c": {"return_code": 30}, "chapter_18/valid/no_structure_parameters/member_access_tests/assign_to_struct.c": {"return_code": 10}, "chapter_18/valid/no_structure_parameters/member_access_tests/pointer_to_struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/get_array_through_pointer.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/nested_struct.c": {"return_code": 16}, "chapter_18/valid/no_structure_parameters/member_access_tests/addr_of_arrow.c": {"return_code": 10}, "chapter_18/valid/no_structure_parameters/member_access_tests/copy_from_pointer.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/static_struct.c": {"return_code": 19}, "chapter_18/valid/no_structure_parameters/member_access_tests/global_nested_struct.c": {"return_code": 8}, "chapter_18/valid/no_structure_parameters/member_access_tests/non_static_struct.c": {"return_code": 9}, "chapter_18/valid/no_structure_parameters/member_access_tests/get_member_addresses.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/member_access_tests/nested_address_calculations.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/member_access_tests/aggregate_through_arrow.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/member_access_tests/copy_to_pointer.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/assign_to_struct_pointer.c": {"return_code": 10}, "chapter_18/valid/no_structure_parameters/libraries/global_struct.c": {"return_code": 9}, "chapter_18/valid/no_structure_parameters/libraries/initializers.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/libraries/incomplete_var.c": {"return_code": 5}, "chapter_18/valid/no_structure_parameters/libraries/nested_pointer_access.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/sizeof/sizeof_wonky.c": {"return_code": 19}, "chapter_18/valid/no_structure_parameters/sizeof/sizeof_struct.c": {"return_code": 8}, "chapter_18/valid/no_structure_parameters/sizeof/sizeof_padded.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/parse_and_lex/postfix_precedence.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/parse_and_lex/space_around_struct_member.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/parse_and_lex/struct_member_looks_like_const.c": {"return_code": 3}, "chapter_18/valid/no_structure_parameters/initializers/nested_struct_init.c": {"return_code": 157}, "chapter_18/valid/no_structure_parameters/initializers/mixed_initialization.c": {"return_code": 7}, "chapter_18/valid/no_structure_parameters/initializers/load_addr_in_init.c": {"return_code": 6}, "chapter_18/valid/no_structure_parameters/initializers/partial_struct_init.c": {"return_code": 26}, "chapter_18/valid/no_structure_parameters/initializers/string_in_global_struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/initializers/string_in_struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/scoping_tests/scoped_struct.c": {"return_code": 2}, "chapter_18/valid/no_structure_parameters/scoping_tests/resolve_tag_for_loop_decl.c": {"return_code": 10}, "chapter_18/valid/no_structure_parameters/scoping_tests/same_tag_name.c": {"return_code": 8}, "chapter_18/valid/no_structure_parameters/scoping_tests/resolve_tags_derived_types.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/scoping_tests/different_namespaces_same_ids.c": {"return_code": 10}, "chapter_18/valid/no_structure_parameters/scoping_tests/resolve_tag_sizeof.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/scoping_tests/same_tag_name_simple.c": {"return_code": 4}, "chapter_18/valid/no_structure_parameters/scoping_tests/declare_struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/scoping_tests/shared_struct_and_var_names.c": {"return_code": 1}, "chapter_18/valid/parameters/pass_struct_as_arg.c": {"return_code": 1}, "chapter_18/valid/parameters/pass_args_on_page_boundary.c": {"return_code": 15}, "chapter_18/valid/parameters/incomplete_param_type.c": {"return_code": 3}, "chapter_18/valid/parameters/pass_struct_and_other_args.c": {"return_code": 1}, "chapter_18/valid/parameters/libraries/param_calling_conventions.c": {"return_code": 0}, "chapter_18/valid/parameters/libraries/preserve_stack.c": {"return_code": 0}, "chapter_18/valid/parameters/libraries/struct_sizes.c": {"return_code": 0}, "chapter_18/valid/parameters/libraries/pass_struct.c": {"return_code": 2}, "chapter_18/valid/parameters/libraries/array_of_structs.c": {"return_code": 0}, "chapter_15/valid/initialization/automatic.c": {"return_code": 0}, "chapter_15/valid/initialization/static.c": {"return_code": 0}, "chapter_15/valid/initialization/trailing_comma_initializer.c": {"return_code": 3}, "chapter_15/valid/initialization/automatic_nested.c": {"return_code": 0}, "chapter_15/valid/initialization/static_nested.c": {"return_code": 0}, "chapter_15/valid/libraries/set_array_val.c": {"return_code": 0}, "chapter_15/valid/libraries/return_pointer_to_array.c": {"return_code": 0}, "chapter_15/valid/libraries/global_array.c": {"return_code": 0}, "chapter_15/valid/subscripting/subscript_nested.c": {"return_code": 0}, "chapter_15/valid/subscripting/subscript_pointer.c": {"return_code": 0}, "chapter_15/valid/subscripting/array_of_pointers_to_arrays.c": {"return_code": 0}, "chapter_15/valid/subscripting/simple_subscripts.c": {"return_code": 0}, "chapter_15/valid/subscripting/simple.c": {"return_code": 3}, "chapter_15/valid/subscripting/complex_operands.c": {"return_code": 0}, "chapter_15/valid/subscripting/addition_subscript_equivalence.c": {"return_code": 0}, "chapter_15/valid/subscripting/subscript_precedence.c": {"return_code": 1}, "chapter_15/valid/allocation/test_alignment.c": {"return_code": 0}, "chapter_15/valid/pointer_arithmetic/pointer_add.c": {"return_code": 0}, "chapter_15/valid/pointer_arithmetic/add_dereference_and_assign.c": {"return_code": 0}, "chapter_15/valid/pointer_arithmetic/pointer_diff.c": {"return_code": 0}, "chapter_15/valid/pointer_arithmetic/compare.c": {"return_code": 0}, "chapter_15/valid/extra_credit/incr_ptr.c": {"return_code": 1}, "chapter_15/valid/declarators/big_array.c": {"return_code": 0}, "chapter_15/valid/declarators/equivalent_declarators.c": {"return_code": 0}, "chapter_15/valid/declarators/return_nested_array.c": {"return_code": 0}, "chapter_15/valid/declarators/array_as_argument.c": {"return_code": 0}, "chapter_15/valid/declarators/for_loop_array.c": {"return_code": 0}, "chapter_15/valid/casts/multi_dim_casts.c": {"return_code": 0}, "chapter_15/valid/casts/implicit_and_explicit_conversions.c": {"return_code": 0}, "chapter_15/valid/casts/cast_array_of_pointers.c": {"return_code": 1}, "chapter_17/valid/void/cast_to_void.c": {"return_code": 12}, "chapter_17/valid/void/void_function.c": {"return_code": 0}, "chapter_17/valid/void/void_for_loop.c": {"return_code": 0, "stdout": "ZYXWVUTSRQPONMLKJIHGFEDCBAABCDEFGHIJKLMNOPQRSTUVWXYZZYXWVUTSRQPONMLKJIHGFEDCBA"}, "chapter_17/valid/void/ternary.c": {"return_code": 0}, "chapter_17/valid/libraries/pass_alloced_memory.c": {"return_code": 0}, "chapter_17/valid/libraries/test_for_memory_leaks.c": {"return_code": 0}, "chapter_17/valid/libraries/sizeof_extern.c": {"return_code": 1}, "chapter_17/valid/sizeof/sizeof_basic_types.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_consts.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_expressions.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_array.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_derived_types.c": {"return_code": 0}, "chapter_17/valid/sizeof/simple.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_result_is_ulong.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_not_evaluated.c": {"return_code": 4}, "chapter_17/valid/void_pointer/array_of_pointers_to_void.c": {"return_code": 0}, "chapter_17/valid/void_pointer/conversion_by_assignment.c": {"return_code": 0}, "chapter_17/valid/void_pointer/explicit_cast.c": {"return_code": 0}, "chapter_17/valid/void_pointer/simple.c": {"return_code": 100}, "chapter_17/valid/void_pointer/memory_management_functions.c": {"return_code": 0}, "chapter_17/valid/void_pointer/common_pointer_type.c": {"return_code": 0}, "chapter_16/valid/strings_as_lvalues/addr_of_string.c": {"return_code": 0, "stdout": "Sample\tstring!\n\n"}, "chapter_16/valid/strings_as_lvalues/standard_library_calls.c": {"return_code": 0, "stdout": "Hello, World!\n"}, "chapter_16/valid/strings_as_lvalues/array_of_strings.c": {"return_code": 0}, "chapter_16/valid/strings_as_lvalues/cast_string_pointer.c": {"return_code": 0}, "chapter_16/valid/strings_as_lvalues/empty_string.c": {"return_code": 0}, "chapter_16/valid/strings_as_lvalues/pointer_operations.c": {"return_code": 0}, "chapter_16/valid/strings_as_lvalues/simple.c": {"return_code": 108}, "chapter_16/valid/strings_as_lvalues/adjacent_strings.c": {"return_code": 0, "stdout": "Hello, World\n"}, "chapter_16/valid/strings_as_lvalues/string_special_characters.c": {"return_code": 0, "stdout": "Hello\"world\nHello\\World\nLine\nbreak!\nTesting, 123.\n^@1 _\\]\n"}, "chapter_16/valid/strings_as_lvalues/strings_in_function_calls.c": {"return_code": 0}, "chapter_16/valid/libraries/return_char.c": {"return_code": 0}, "chapter_16/valid/libraries/char_arguments.c": {"return_code": 0}, "chapter_16/valid/libraries/global_char.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/array_init_special_chars.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/terminating_null_bytes.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/simple.c": {"return_code": 99}, "chapter_16/valid/strings_as_initializers/partial_initialize_via_string.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/adjacent_strings_in_initializer.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/transfer_by_eightbyte.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/literals_and_compound_initializers.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/write_to_array.c": {"return_code": 0, "stdout": "abc\nabx\nHello\nWorld\nJello\n"}, "chapter_16/valid/strings_as_initializers/test_alignment.c": {"return_code": 0}, "chapter_16/valid/char_constants/return_char_constant.c": {"return_code": 99}, "chapter_16/valid/char_constants/escape_sequences.c": {"return_code": 0}, "chapter_16/valid/char_constants/control_characters.c": {"return_code": 0}, "chapter_16/valid/char_constants/char_constant_operations.c": {"return_code": 0}, "chapter_16/valid/chars/partial_initialization.c": {"return_code": 0}, "chapter_16/valid/chars/convert_by_assignment.c": {"return_code": 0}, "chapter_16/valid/chars/type_specifiers.c": {"return_code": 0}, "chapter_16/valid/chars/push_arg_on_page_boundary.c": {"return_code": 1}, "chapter_16/valid/chars/integer_promotion.c": {"return_code": 0}, "chapter_16/valid/chars/chained_casts.c": {"return_code": 0}, "chapter_16/valid/chars/return_char.c": {"return_code": 0}, "chapter_16/valid/chars/char_arguments.c": {"return_code": 0}, "chapter_16/valid/chars/char_expressions.c": {"return_code": 0}, "chapter_16/valid/chars/access_through_char_pointer.c": {"return_code": 0}, "chapter_16/valid/chars/common_type.c": {"return_code": 0}, "chapter_16/valid/chars/static_initializers.c": {"return_code": 0}, "chapter_16/valid/chars/explicit_casts.c": {"return_code": 0}, "chapter_9/valid/arguments_in_registers/parameter_shadows_own_function.c": {"return_code": 2}, "chapter_9/valid/arguments_in_registers/expression_args.c": {"return_code": 2}, "chapter_9/valid/arguments_in_registers/single_arg.c": {"return_code": 6}, "chapter_9/valid/arguments_in_registers/hello_world.c": {"return_code": 0, "stdout": "Hello, World!\n"}, "chapter_9/valid/arguments_in_registers/parameter_shadows_function.c": {"return_code": 3}, "chapter_9/valid/arguments_in_registers/parameters_are_preserved.c": {"return_code": 1}, "chapter_9/valid/arguments_in_registers/forward_decl_multi_arg.c": {"return_code": 1}, "chapter_9/valid/arguments_in_registers/fibonacci.c": {"return_code": 8}, "chapter_9/valid/arguments_in_registers/param_shadows_local_var.c": {"return_code": 20}, "chapter_9/valid/no_arguments/function_shadows_variable.c": {"return_code": 11}, "chapter_9/valid/no_arguments/use_function_in_expression.c": {"return_code": 21}, "chapter_9/valid/no_arguments/no_return_value.c": {"return_code": 3}, "chapter_9/valid/no_arguments/multiple_declarations.c": {"return_code": 3}, "chapter_9/valid/no_arguments/precedence.c": {"return_code": 0}, "chapter_9/valid/no_arguments/forward_decl.c": {"return_code": 3}, "chapter_9/valid/no_arguments/variable_shadows_function.c": {"return_code": 7}, "chapter_9/valid/libraries/system_call.c": {"return_code": 0, "stdout": "H"}, "chapter_9/valid/libraries/many_args.c": {"return_code": 115}, "chapter_9/valid/libraries/addition.c": {"return_code": 3}, "chapter_9/valid/libraries/no_function_calls/division.c": {"return_code": 1}, "chapter_9/valid/libraries/no_function_calls/local_stack_variables.c": {"return_code": 100}, "chapter_9/valid/extra_credit/compound_assign_function_result.c": {"return_code": 1}, "chapter_9/valid/extra_credit/goto_label_multiple_functions.c": {"return_code": 5}, "chapter_9/valid/extra_credit/goto_shared_name.c": {"return_code": 1}, "chapter_9/valid/stack_arguments/call_putchar.c": {"return_code": 8, "stdout": "A"}, "chapter_9/valid/stack_arguments/lots_of_arguments.c": {"return_code": 1}, "chapter_9/valid/stack_arguments/stack_alignment.c": {"return_code": 1}, "chapter_9/valid/stack_arguments/test_for_memory_leaks.c": {"return_code": 1}, "chapter_12/valid/unsigned_expressions/logical.c": {"return_code": 0}, "chapter_12/valid/unsigned_expressions/arithmetic_wraparound.c": {"return_code": 1}, "chapter_12/valid/unsigned_expressions/arithmetic_ops.c": {"return_code": 0}, "chapter_12/valid/unsigned_expressions/comparisons.c": {"return_code": 0}, "chapter_12/valid/unsigned_expressions/simple.c": {"return_code": 1}, "chapter_12/valid/unsigned_expressions/static_variables.c": {"return_code": 1}, "chapter_12/valid/unsigned_expressions/locals.c": {"return_code": 0}, "chapter_12/valid/libraries/unsigned_args.c": {"return_code": 0}, "chapter_12/valid/libraries/unsigned_global_var.c": {"return_code": 1}, "chapter_12/valid/explicit_casts/same_size_conversion.c": {"return_code": 0}, "chapter_12/valid/explicit_casts/extension.c": {"return_code": 0}, "chapter_12/valid/explicit_casts/round_trip_casts.c": {"return_code": 0}, "chapter_12/valid/explicit_casts/chained_casts.c": {"return_code": 0}, "chapter_12/valid/explicit_casts/truncate.c": {"return_code": 0}, "chapter_12/valid/type_specifiers/signed_type_specifiers.c": {"return_code": 0}, "chapter_12/valid/type_specifiers/unsigned_type_specifiers.c": {"return_code": 0}, "chapter_12/valid/implicit_casts/convert_by_assignment.c": {"return_code": 0}, "chapter_12/valid/implicit_casts/promote_constants.c": {"return_code": 0}, "chapter_12/valid/implicit_casts/common_type.c": {"return_code": 0}, "chapter_12/valid/implicit_casts/static_initializers.c": {"return_code": 0}, "chapter_12/valid/extra_credit/switch_uint.c": {"return_code": 0}, "chapter_12/valid/extra_credit/compound_assign_uint.c": {"return_code": 1}, "chapter_12/valid/extra_credit/bitwise_unsigned_shift.c": {"return_code": 1}, "chapter_12/valid/extra_credit/bitwise_unsigned_ops.c": {"return_code": 1}, "chapter_5/valid/null_then_return.c": {"return_code": 0}, "chapter_5/valid/empty_function_body.c": {"return_code": 0}, "chapter_5/valid/short_circuit_or.c": {"return_code": 0}, "chapter_5/valid/assignment_in_initializer.c": {"return_code": 0}, "chapter_5/valid/non_short_circuit_or.c": {"return_code": 1}, "chapter_5/valid/null_statement.c": {"return_code": 0}, "chapter_5/valid/short_circuit_and_fail.c": {"return_code": 0}, "chapter_5/valid/local_var_missing_return.c": {"return_code": 0}, "chapter_5/valid/exp_then_declaration.c": {"return_code": 1}, "chapter_5/valid/add_variables.c": {"return_code": 3}, "chapter_5/valid/assign_val_in_initializer.c": {"return_code": 5}, "chapter_5/valid/assignment_lowest_precedence.c": {"return_code": 1}, "chapter_5/valid/allocate_temps_and_vars.c": {"return_code": 1}, "chapter_5/valid/use_assignment_result.c": {"return_code": 4}, "chapter_5/valid/use_val_in_own_initializer.c": {"return_code": 0}, "chapter_5/valid/unused_exp.c": {"return_code": 0}, "chapter_5/valid/return_var.c": {"return_code": 2}, "chapter_5/valid/mixed_precedence_assignment.c": {"return_code": 4}, "chapter_5/valid/assign.c": {"return_code": 2}, "chapter_5/valid/extra_credit/bitwise_shiftr_assign.c": {"return_code": 77}, "chapter_5/valid/extra_credit/bitwise_shiftl_variable.c": {"return_code": 24}, "chapter_5/valid/extra_credit/compound_bitwise_and.c": {"return_code": 2}, "chapter_5/valid/extra_credit/compound_minus.c": {"return_code": 2}, "chapter_5/valid/extra_credit/compound_multiply.c": {"return_code": 12}, "chapter_5/valid/extra_credit/compound_bitwise_xor.c": {"return_code": 2}, "chapter_5/valid/extra_credit/compound_bitwise_or.c": {"return_code": 31}, "chapter_5/valid/extra_credit/compound_assignment_chained.c": {"return_code": 4}, "chapter_5/valid/extra_credit/compound_divide.c": {"return_code": 2}, "chapter_5/valid/extra_credit/compound_bitwise_shiftr.c": {"return_code": 102}, "chapter_5/valid/extra_credit/compound_assignment_use_result.c": {"return_code": 8}, "chapter_5/valid/extra_credit/compound_bitwise_shiftl.c": {"return_code": 48}, "chapter_5/valid/extra_credit/compound_plus.c": {"return_code": 4}, "chapter_5/valid/extra_credit/compound_mod.c": {"return_code": 2}, "chapter_5/valid/extra_credit/bitwise_and_vars.c": {"return_code": 1}, "chapter_7/valid/declaration_only.c": {"return_code": 1}, "chapter_7/valid/assign_to_self_2.c": {"return_code": 3}, "chapter_7/valid/hidden_then_visible.c": {"return_code": 1}, "chapter_7/valid/hidden_variable.c": {"return_code": 1}, "chapter_7/valid/assign_to_self.c": {"return_code": 4}, "chapter_7/valid/inner_uninitialized.c": {"return_code": 4}, "chapter_7/valid/multiple_vars_same_name.c": {"return_code": 2}, "chapter_7/valid/use_in_inner_scope.c": {"return_code": 3}, "chapter_7/valid/empty_blocks.c": {"return_code": 30}, "chapter_7/valid/nested_if.c": {"return_code": 1}, "chapter_7/valid/similar_var_names.c": {"return_code": 28}, "chapter_7/valid/extra_credit/goto_before_declaration.c": {"return_code": 0}, "chapter_7/valid/extra_credit/compound_subtract_in_block.c": {"return_code": 1}, "chapter_7/valid/extra_credit/goto_inner_scope.c": {"return_code": 1}, "chapter_4/valid/le_true.c": {"return_code": 2}, "chapter_4/valid/ne_true.c": {"return_code": 1}, "chapter_4/valid/ge_false.c": {"return_code": 0}, "chapter_4/valid/not_zero.c": {"return_code": 1}, "chapter_4/valid/precedence_2.c": {"return_code": 0}, "chapter_4/valid/ge_true.c": {"return_code": 2}, "chapter_4/valid/eq_precedence.c": {"return_code": 1}, "chapter_4/valid/eq_false.c": {"return_code": 0}, "chapter_4/valid/or_short_circuit.c": {"return_code": 1}, "chapter_4/valid/not_sum.c": {"return_code": 1}, "chapter_4/valid/precedence_4.c": {"return_code": 1}, "chapter_4/valid/and_short_circuit.c": {"return_code": 0}, "chapter_4/valid/precedence_3.c": {"return_code": 0}, "chapter_4/valid/compare_arithmetic_results.c": {"return_code": 1}, "chapter_4/valid/and_false.c": {"return_code": 0}, "chapter_4/valid/precedence_5.c": {"return_code": 1}, "chapter_4/valid/associativity.c": {"return_code": 1}, "chapter_4/valid/gt_true.c": {"return_code": 1}, "chapter_4/valid/lt_false.c": {"return_code": 0}, "chapter_4/valid/or_true.c": {"return_code": 3}, "chapter_4/valid/or_false.c": {"return_code": 0}, "chapter_4/valid/eq_true.c": {"return_code": 1}, "chapter_4/valid/ne_false.c": {"return_code": 0}, "chapter_4/valid/multi_short_circuit.c": {"return_code": 0}, "chapter_4/valid/gt_false.c": {"return_code": 0}, "chapter_4/valid/operate_on_booleans.c": {"return_code": 0}, "chapter_4/valid/not.c": {"return_code": 0}, "chapter_4/valid/le_false.c": {"return_code": 0}, "chapter_4/valid/nested_ops.c": {"return_code": 0}, "chapter_4/valid/precedence.c": {"return_code": 1}, "chapter_4/valid/not_sum_2.c": {"return_code": 0}, "chapter_4/valid/and_true.c": {"return_code": 1}, "chapter_4/valid/lt_true.c": {"return_code": 1}, "chapter_4/valid/extra_credit/bitwise_precedence.c": {"return_code": 1}, "chapter_3/valid/mod.c": {"return_code": 0}, "chapter_3/valid/unop_add.c": {"return_code": 0}, "chapter_3/valid/associativity_3.c": {"return_code": 8}, "chapter_3/valid/mult.c": {"return_code": 6}, "chapter_3/valid/sub.c": {"return_code": 255}, "chapter_3/valid/div_neg.c": {"return_code": 254}, "chapter_3/valid/unop_parens.c": {"return_code": 253}, "chapter_3/valid/add.c": {"return_code": 3}, "chapter_3/valid/associativity.c": {"return_code": 252}, "chapter_3/valid/associativity_2.c": {"return_code": 1}, "chapter_3/valid/div.c": {"return_code": 2}, "chapter_3/valid/sub_neg.c": {"return_code": 3}, "chapter_3/valid/associativity_and_precedence.c": {"return_code": 10}, "chapter_3/valid/parens.c": {"return_code": 14}, "chapter_3/valid/precedence.c": {"return_code": 14}, "chapter_3/valid/extra_credit/bitwise_shiftr.c": {"return_code": 62}, "chapter_3/valid/extra_credit/bitwise_and.c": {"return_code": 1}, "chapter_3/valid/extra_credit/bitwise_shiftl.c": {"return_code": 140}, "chapter_3/valid/extra_credit/bitwise_or.c": {"return_code": 3}, "chapter_3/valid/extra_credit/bitwise_shift_precedence.c": {"return_code": 0}, "chapter_3/valid/extra_credit/bitwise_xor.c": {"return_code": 6}, "chapter_3/valid/extra_credit/bitwise_shift_associativity_2.c": {"return_code": 16}, "chapter_3/valid/extra_credit/bitwise_shift_associativity.c": {"return_code": 66}, "chapter_3/valid/extra_credit/bitwise_precedence.c": {"return_code": 21}, "chapter_11/valid/long_expressions/long_args.c": {"return_code": 0}, "chapter_11/valid/long_expressions/logical.c": {"return_code": 0}, "chapter_11/valid/long_expressions/type_specifiers.c": {"return_code": 0}, "chapter_11/valid/long_expressions/multi_op.c": {"return_code": 1}, "chapter_11/valid/long_expressions/large_constants.c": {"return_code": 0}, "chapter_11/valid/long_expressions/arithmetic_ops.c": {"return_code": 0}, "chapter_11/valid/long_expressions/return_long.c": {"return_code": 1}, "chapter_11/valid/long_expressions/comparisons.c": {"return_code": 0}, "chapter_11/valid/long_expressions/simple.c": {"return_code": 1}, "chapter_11/valid/long_expressions/static_long.c": {"return_code": 1}, "chapter_11/valid/long_expressions/long_and_int_locals.c": {"return_code": 0}, "chapter_11/valid/long_expressions/assign.c": {"return_code": 1}, "chapter_11/valid/libraries/long_args.c": {"return_code": 0}, "chapter_11/valid/libraries/maintain_stack_alignment.c": {"return_code": 12}, "chapter_11/valid/libraries/return_long.c": {"return_code": 1}, "chapter_11/valid/libraries/long_global_var.c": {"return_code": 0}, "chapter_11/valid/explicit_casts/truncate.c": {"return_code": 0}, "chapter_11/valid/explicit_casts/sign_extend.c": {"return_code": 0}, "chapter_11/valid/implicit_casts/convert_by_assignment.c": {"return_code": 0}, "chapter_11/valid/implicit_casts/common_type.c": {"return_code": 0}, "chapter_11/valid/implicit_casts/long_constants.c": {"return_code": 0}, "chapter_11/valid/implicit_casts/convert_function_arguments.c": {"return_code": 0}, "chapter_11/valid/implicit_casts/convert_static_initializer.c": {"return_code": 0}, "chapter_11/valid/extra_credit/bitwise_long_op.c": {"return_code": 1}, "chapter_11/valid/extra_credit/compound_assign_to_int.c": {"return_code": 1}, "chapter_11/valid/extra_credit/compound_assign_to_long.c": {"return_code": 1}, "chapter_11/valid/extra_credit/switch_int.c": {"return_code": 1}, "chapter_11/valid/extra_credit/switch_long.c": {"return_code": 1}, "chapter_19/whole_pipeline/all_types/alias_analysis_change.c": {"return_code": 0}, "chapter_19/whole_pipeline/int_only/dead_condition.c": {"return_code": 10}, "chapter_19/whole_pipeline/int_only/elim_and_copy_prop.c": {"return_code": 10}, "chapter_19/whole_pipeline/int_only/remainder_test.c": {"return_code": 1}, "chapter_19/dead_store_elimination/all_types/aliased_dead_at_exit.c": {"return_code": 1}, "chapter_19/dead_store_elimination/all_types/getaddr_doesnt_gen.c": {"return_code": 0}, "chapter_19/dead_store_elimination/all_types/copy_to_dead_struct.c": {"return_code": 4}, "chapter_19/dead_store_elimination/all_types/dont_elim/copytooffset_doesnt_kill.c": {"return_code": 101}, "chapter_19/dead_store_elimination/all_types/dont_elim/store_generates_dst.c": {"return_code": 4}, "chapter_19/dead_store_elimination/all_types/dont_elim/load_generates_pointer.c": {"return_code": 10}, "chapter_19/dead_store_elimination/all_types/dont_elim/load_through_pointer.c": {"return_code": 10}, "chapter_19/dead_store_elimination/all_types/dont_elim/pass_pointer_to_fun.c": {"return_code": 5}, "chapter_19/dead_store_elimination/all_types/dont_elim/never_kill_store.c": {"return_code": 4}, "chapter_19/dead_store_elimination/all_types/dont_elim/copyfromoffset_gen.c": {"return_code": 3}, "chapter_19/dead_store_elimination/int_only/fig_19_12.c": {"return_code": 9}, "chapter_19/dead_store_elimination/int_only/use_and_kill.c": {"return_code": 5}, "chapter_19/dead_store_elimination/int_only/dead_store_static_var.c": {"return_code": 1}, "chapter_19/dead_store_elimination/int_only/loop_dead_store.c": {"return_code": 51}, "chapter_19/dead_store_elimination/int_only/simple.c": {"return_code": 3}, "chapter_19/dead_store_elimination/int_only/elim_second_copy.c": {"return_code": 10}, "chapter_19/dead_store_elimination/int_only/dont_elim/static_vars_at_exit.c": {"return_code": 1}, "chapter_19/dead_store_elimination/int_only/dont_elim/used_one_path.c": {"return_code": 40}, "chapter_19/dead_store_elimination/int_only/dont_elim/dont_remove_funcall.c": {"return_code": 0, "stdout": "C"}, "chapter_19/dead_store_elimination/int_only/dont_elim/add_all_to_worklist.c": {"return_code": 0, "stdout": "L"}, "chapter_19/dead_store_elimination/int_only/dont_elim/loop.c": {"return_code": 54}, "chapter_19/dead_store_elimination/int_only/dont_elim/static_vars_fun.c": {"return_code": 5}, "chapter_19/unreachable_code_elimination/remove_useless_starting_label.c": {"return_code": 99}, "chapter_19/unreachable_code_elimination/dead_for_loop.c": {"return_code": 10}, "chapter_19/unreachable_code_elimination/remove_jnz.c": {"return_code": 1}, "chapter_19/unreachable_code_elimination/dead_branch_inside_loop.c": {"return_code": 19}, "chapter_19/unreachable_code_elimination/empty.c": {"return_code": 0}, "chapter_19/unreachable_code_elimination/constant_if_else.c": {"return_code": 45}, "chapter_19/unreachable_code_elimination/loop_in_dead_branch.c": {"return_code": 0}, "chapter_19/unreachable_code_elimination/dead_after_return.c": {"return_code": 2}, "chapter_19/unreachable_code_elimination/empty_block.c": {"return_code": 1}, "chapter_19/unreachable_code_elimination/dead_after_if_else.c": {"return_code": 1}, "chapter_19/unreachable_code_elimination/dont_elim/keep_final_jump.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_cast_to_double.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_ulong.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_double.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_long.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_uint.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_cast_from_double.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/truncate.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/zero_and_sign_extend.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_divide_by_zero.c": {"return_code": 1}, "chapter_19/constant_folding/int_only/fold_unary.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_dead_branch.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_conditional_jump.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_comparisons.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_arithmetic.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_overflow.c": {"return_code": 0}, "chapter_19/copy_propagation/all_types/pointer_arithmetic.c": {"return_code": 2}, "chapter_19/copy_propagation/all_types/store_doesnt_kill.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/unsigned_wraparound.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/propagate_doubles.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/unsigned_compare.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/signed_unsigned_conversion.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/char_type_conversion.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/not_char.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/char_round_trip_2.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/alias_analysis.c": {"return_code": 24}, "chapter_19/copy_propagation/all_types/const_fold_sign_extend.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/copy_struct.c": {"return_code": 6}, "chapter_19/copy_propagation/all_types/propagate_null_pointer.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/char_round_trip.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/const_fold_type_conversions.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/const_fold_sign_extend_2.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/dont_propagate/static_are_aliased.c": {"return_code": 8}, "chapter_19/copy_propagation/all_types/dont_propagate/store_kills_aliased.c": {"return_code": 0}, "chapter_19/copy_propagation/all_types/dont_propagate/copy_to_offset.c": {"return_code": 3}, "chapter_19/copy_propagation/all_types/dont_propagate/dont_propagate_addr_of.c": {"return_code": 0}, "chapter_19/copy_propagation/all_types/dont_propagate/type_conversion.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/dont_propagate/zero_neg_zero_different.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/dont_propagate/funcall_kills_aliased.c": {"return_code": 2}, "chapter_19/copy_propagation/int_only/propagate_fun_args.c": {"return_code": 220}, "chapter_19/copy_propagation/int_only/killed_then_redefined.c": {"return_code": 2}, "chapter_19/copy_propagation/int_only/redundant_copies_2.c": {"return_code": 10}, "chapter_19/copy_propagation/int_only/multi_path_no_kill.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/redundant_copies.c": {"return_code": 10}, "chapter_19/copy_propagation/int_only/fig_19_8.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/kill_and_add_copies.c": {"return_code": 14}, "chapter_19/copy_propagation/int_only/multi_instance_same_copy.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/init_all_copies.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/complex_const_fold.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/copy_prop_const_fold.c": {"return_code": 6}, "chapter_19/copy_propagation/int_only/prop_static_var.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/propagate_var.c": {"return_code": 6}, "chapter_19/copy_propagation/int_only/multi_path.c": {"return_code": 6}, "chapter_19/copy_propagation/int_only/loop.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/dont_propagate/source_killed_on_one_path.c": {"return_code": 8}, "chapter_19/copy_propagation/int_only/dont_propagate/one_reaching_copy.c": {"return_code": 3}, "chapter_19/copy_propagation/int_only/dont_propagate/listing_20_15.c": {"return_code": 101}, "chapter_19/copy_propagation/int_only/dont_propagate/dest_killed.c": {"return_code": 4}, "chapter_19/copy_propagation/int_only/dont_propagate/no_copies_reach_entry.c": {"return_code": 4}, "chapter_19/copy_propagation/int_only/dont_propagate/add_all_blocks_to_worklist.c": {"return_code": 4}, "chapter_19/copy_propagation/int_only/dont_propagate/multi_values.c": {"return_code": 7}, "chapter_19/copy_propagation/int_only/dont_propagate/static_dst_killed.c": {"return_code": 4}, "chapter_19/copy_propagation/int_only/dont_propagate/static_src_killed.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/dont_propagate/source_killed.c": {"return_code": 10}, "chapter_20/all_types/no_coalescing/mixed_ints.c": {"return_code": 9}, "chapter_20/all_types/no_coalescing/dbl_trivially_colorable.c": {"return_code": 3}, "chapter_20/all_types/no_coalescing/spill_movz_dst.c": {"return_code": 29}, "chapter_20/all_types/no_coalescing/push_xmm.c": {"return_code": 1}, "chapter_20/all_types/no_coalescing/dbl_fun_call.c": {"return_code": 1}, "chapter_20/all_types/no_coalescing/stack_alignment.c": {"return_code": 1}, "chapter_20/all_types/no_coalescing/track_dbl_arg_registers.c": {"return_code": 1}, "chapter_20/all_types/no_coalescing/fourteen_pseudos_interfere.c": {"return_code": 0}, "chapter_20/all_types/no_coalescing/div_interference.c": {"return_code": 1}, "chapter_20/all_types/no_coalescing/test_spilling_dbls.c": {"return_code": 3}, "chapter_20/all_types/no_coalescing/store_pointer_in_register.c": {"return_code": 0}, "chapter_20/int_only/no_coalescing/same_instr_interference.c": {"return_code": 6}, "chapter_20/int_only/no_coalescing/spills_rewrites_compare.c": {"return_code": 3}, "chapter_20/int_only/no_coalescing/copy_and_separate_interference.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/spills_and_rewrites.c": {"return_code": 23}, "chapter_20/int_only/no_coalescing/cmp_liveness.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/rewrite_large_multiply.c": {"return_code": 58}, "chapter_20/int_only/no_coalescing/spill_callee_saved.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/test_spill_metric.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/unary_interference.c": {"return_code": 10}, "chapter_20/int_only/no_coalescing/optimistic_coloring.c": {"return_code": 0}, "chapter_20/int_only/no_coalescing/track_arg_registers.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/many_pseudos_fewer_conflicts.c": {"return_code": 0}, "chapter_20/int_only/no_coalescing/same_instr_no_interference.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/copy_no_interference.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/force_spill.c": {"return_code": 9}, "chapter_20/int_only/no_coalescing/callee_saved_stack_alignment.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/idiv_interference.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/preserve_across_fun_call.c": {"return_code": 0}, "chapter_20/int_only/no_coalescing/use_all_hardregs.c": {"return_code": 0}, "chapter_20/int_only/no_coalescing/test_spill_metric_2.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/loop.c": {"return_code": 6}, "chapter_20/int_only/no_coalescing/trivially_colorable.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/cdq_interference.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/cdq_generates_ax.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/callee_saved_live_at_exit.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/coalesce_prevents_spill.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/george_coalesce.c": {"return_code": 1}, "chapter_20/int_only/with_coalescing/unary_generates_dst.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/briggs_coalesce.c": {"return_code": 2}, "chapter_20/int_only/with_coalescing/bin_generates_dst.c": {"return_code": 187}, "chapter_20/int_only/with_coalescing/briggs_coalesce_tmps.c": {"return_code": 1}, "chapter_20/int_only/with_coalescing/cmp_generates_operands.c": {"return_code": 1}, "chapter_20/int_only/with_coalescing/funcall_generates_args.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/eax_live_at_exit.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/pass_pointer_to_struct.c": {"return_code": 112}} \ No newline at end of file +{"chapter_6/valid/rh_assignment.c": {"return_code": 1}, "chapter_6/valid/if_nested_2.c": {"return_code": 2}, "chapter_6/valid/if_nested_3.c": {"return_code": 3}, "chapter_6/valid/nested_ternary.c": {"return_code": 7}, "chapter_6/valid/binary_false_condition.c": {"return_code": 0}, "chapter_6/valid/else.c": {"return_code": 2}, "chapter_6/valid/nested_ternary_2.c": {"return_code": 15}, "chapter_6/valid/ternary_short_circuit.c": {"return_code": 1}, "chapter_6/valid/multiple_if.c": {"return_code": 8}, "chapter_6/valid/if_null_body.c": {"return_code": 1}, "chapter_6/valid/ternary_rh_binop.c": {"return_code": 1}, "chapter_6/valid/ternary_middle_assignment.c": {"return_code": 2}, "chapter_6/valid/if_nested_4.c": {"return_code": 4}, "chapter_6/valid/ternary_middle_binop.c": {"return_code": 1}, "chapter_6/valid/if_taken.c": {"return_code": 1}, "chapter_6/valid/if_not_taken.c": {"return_code": 0}, "chapter_6/valid/if_nested_5.c": {"return_code": 1}, "chapter_6/valid/assign_ternary.c": {"return_code": 2}, "chapter_6/valid/ternary.c": {"return_code": 4}, "chapter_6/valid/if_nested.c": {"return_code": 1}, "chapter_6/valid/ternary_short_circuit_2.c": {"return_code": 2}, "chapter_6/valid/binary_condition.c": {"return_code": 5}, "chapter_6/valid/extra_credit/goto_label_and_var.c": {"return_code": 5}, "chapter_6/valid/extra_credit/goto_label_main_2.c": {"return_code": 0}, "chapter_6/valid/extra_credit/bitwise_ternary.c": {"return_code": 5}, "chapter_6/valid/extra_credit/goto_label_main.c": {"return_code": 0}, "chapter_6/valid/extra_credit/goto_nested_label.c": {"return_code": 5}, "chapter_6/valid/extra_credit/goto_backwards.c": {"return_code": 5}, "chapter_6/valid/extra_credit/goto_label.c": {"return_code": 1}, "chapter_6/valid/extra_credit/compound_if_expression.c": {"return_code": 1}, "chapter_6/valid/extra_credit/goto_after_declaration.c": {"return_code": 1}, "chapter_8/valid/for.c": {"return_code": 16}, "chapter_8/valid/continue.c": {"return_code": 1}, "chapter_8/valid/multi_continue_same_loop.c": {"return_code": 1}, "chapter_8/valid/for_absent_post.c": {"return_code": 0}, "chapter_8/valid/null_for_header.c": {"return_code": 4}, "chapter_8/valid/nested_loop.c": {"return_code": 1}, "chapter_8/valid/nested_break.c": {"return_code": 250}, "chapter_8/valid/do_while.c": {"return_code": 16}, "chapter_8/valid/for_absent_condition.c": {"return_code": 0}, "chapter_8/valid/do_while_break_immediate.c": {"return_code": 10}, "chapter_8/valid/continue_empty_post.c": {"return_code": 30}, "chapter_8/valid/nested_continue.c": {"return_code": 24}, "chapter_8/valid/break.c": {"return_code": 1}, "chapter_8/valid/for_nested_shadow.c": {"return_code": 1}, "chapter_8/valid/empty_expression.c": {"return_code": 0}, "chapter_8/valid/multi_break.c": {"return_code": 1}, "chapter_8/valid/for_decl.c": {"return_code": 101}, "chapter_8/valid/for_shadow.c": {"return_code": 1}, "chapter_8/valid/break_immediate.c": {"return_code": 1}, "chapter_8/valid/while.c": {"return_code": 6}, "chapter_8/valid/empty_loop_body.c": {"return_code": 252}, "chapter_8/valid/extra_credit/switch_fallthrough.c": {"return_code": 4}, "chapter_8/valid/extra_credit/compound_assignment_for_loop.c": {"return_code": 10}, "chapter_8/valid/extra_credit/switch_break.c": {"return_code": 5}, "chapter_8/valid/extra_credit/switch_default.c": {"return_code": 22}, "chapter_8/valid/extra_credit/switch_default_fallthrough.c": {"return_code": 0}, "chapter_8/valid/extra_credit/switch_with_loop.c": {"return_code": 123}, "chapter_8/valid/extra_credit/switch_assign_in_body.c": {"return_code": 3}, "chapter_8/valid/extra_credit/switch_in_loop.c": {"return_code": 1}, "chapter_8/valid/extra_credit/switch_no_case.c": {"return_code": 4}, "chapter_8/valid/extra_credit/switch_nested_case.c": {"return_code": 3}, "chapter_8/valid/extra_credit/switch_nested_not_taken.c": {"return_code": 2}, "chapter_8/valid/extra_credit/switch_decl.c": {"return_code": 7}, "chapter_8/valid/extra_credit/switch_with_continue.c": {"return_code": 5}, "chapter_8/valid/extra_credit/switch_empty.c": {"return_code": 10}, "chapter_8/valid/extra_credit/goto_loop_body.c": {"return_code": 1}, "chapter_8/valid/extra_credit/goto_bypass_condition.c": {"return_code": 10}, "chapter_8/valid/extra_credit/switch_nested_switch.c": {"return_code": 1}, "chapter_8/valid/extra_credit/switch_block.c": {"return_code": 1}, "chapter_8/valid/extra_credit/switch_default_not_last.c": {"return_code": 0}, "chapter_8/valid/extra_credit/switch_assign_in_condition.c": {"return_code": 2}, "chapter_8/valid/extra_credit/switch.c": {"return_code": 3}, "chapter_8/valid/extra_credit/switch_goto_mid_case.c": {"return_code": 1}, "chapter_14/valid/libraries/static_pointer.c": {"return_code": 0}, "chapter_14/valid/libraries/global_pointer.c": {"return_code": 1}, "chapter_14/valid/function_calls/address_of_argument.c": {"return_code": 0}, "chapter_14/valid/function_calls/update_value_through_pointer_parameter.c": {"return_code": 0}, "chapter_14/valid/function_calls/return_pointer.c": {"return_code": 0}, "chapter_14/valid/extra_credit/incr_through_pointer.c": {"return_code": 11}, "chapter_14/valid/extra_credit/compound_assign_through_pointer.c": {"return_code": 1}, "chapter_14/valid/declarators/declare_pointer_in_for_loop.c": {"return_code": 5}, "chapter_14/valid/declarators/abstract_declarators.c": {"return_code": 0}, "chapter_14/valid/declarators/declarators.c": {"return_code": 0}, "chapter_14/valid/dereference/static_var_indirection.c": {"return_code": 0}, "chapter_14/valid/dereference/multilevel_indirection.c": {"return_code": 0}, "chapter_14/valid/dereference/read_through_pointers.c": {"return_code": 0}, "chapter_14/valid/dereference/update_through_pointers.c": {"return_code": 0}, "chapter_14/valid/dereference/address_of_dereference.c": {"return_code": 0}, "chapter_14/valid/dereference/simple.c": {"return_code": 3}, "chapter_14/valid/dereference/dereference_expression_result.c": {"return_code": 0}, "chapter_14/valid/casts/cast_between_pointer_types.c": {"return_code": 0}, "chapter_14/valid/casts/pointer_int_casts.c": {"return_code": 0}, "chapter_14/valid/casts/null_pointer_conversion.c": {"return_code": 0}, "chapter_14/valid/comparisons/compare_pointers.c": {"return_code": 0}, "chapter_14/valid/comparisons/pointers_as_conditions.c": {"return_code": 0}, "chapter_14/valid/comparisons/compare_to_null.c": {"return_code": 0}, "chapter_10/valid/static_then_extern.c": {"return_code": 3}, "chapter_10/valid/push_arg_on_page_boundary.c": {"return_code": 1}, "chapter_10/valid/static_local_multiple_scopes.c": {"return_code": 0, "stdout": "Aa\nBb\nCc\nDd\nEe\nFf\nGg\nHh\nIi\nJj\nKk\nLl\nMm\nNn\nOo\nPp\nQq\nRr\nSs\nTt\nUu\nVv\nWw\nXx\nYy\nZz\n"}, "chapter_10/valid/tentative_definition.c": {"return_code": 5}, "chapter_10/valid/static_variables_in_expressions.c": {"return_code": 0}, "chapter_10/valid/static_recursive_call.c": {"return_code": 0, "stdout": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"}, "chapter_10/valid/shadow_static_local_var.c": {"return_code": 0}, "chapter_10/valid/multiple_static_local.c": {"return_code": 29}, "chapter_10/valid/multiple_static_file_scope_vars.c": {"return_code": 4}, "chapter_10/valid/static_local_uninitialized.c": {"return_code": 4}, "chapter_10/valid/type_before_storage_class.c": {"return_code": 7}, "chapter_10/valid/extern_block_scope_variable.c": {"return_code": 3}, "chapter_10/valid/distinct_local_and_extern.c": {"return_code": 7}, "chapter_10/valid/libraries/internal_hides_external_linkage.c": {"return_code": 0}, "chapter_10/valid/libraries/external_tentative_var.c": {"return_code": 0}, "chapter_10/valid/libraries/external_linkage_function.c": {"return_code": 0}, "chapter_10/valid/libraries/external_variable.c": {"return_code": 0}, "chapter_10/valid/libraries/internal_linkage_var.c": {"return_code": 0}, "chapter_10/valid/libraries/external_var_scoping.c": {"return_code": 0}, "chapter_10/valid/libraries/internal_linkage_function.c": {"return_code": 0}, "chapter_10/valid/extra_credit/goto_skip_static_initializer.c": {"return_code": 10}, "chapter_2/valid/neg.c": {"return_code": 251}, "chapter_2/valid/negate_int_max.c": {"return_code": 1}, "chapter_2/valid/redundant_parens.c": {"return_code": 246}, "chapter_2/valid/neg_zero.c": {"return_code": 0}, "chapter_2/valid/bitwise_int_min.c": {"return_code": 254}, "chapter_2/valid/bitwise_zero.c": {"return_code": 255}, "chapter_2/valid/parens_3.c": {"return_code": 4}, "chapter_2/valid/parens_2.c": {"return_code": 253}, "chapter_2/valid/bitwise.c": {"return_code": 243}, "chapter_2/valid/nested_ops_2.c": {"return_code": 1}, "chapter_2/valid/nested_ops.c": {"return_code": 2}, "chapter_2/valid/parens.c": {"return_code": 254}, "chapter_1/valid/return_0.c": {"return_code": 0}, "chapter_1/valid/newlines.c": {"return_code": 0}, "chapter_1/valid/return_2.c": {"return_code": 2}, "chapter_1/valid/multi_digit.c": {"return_code": 100}, "chapter_1/valid/tabs.c": {"return_code": 0}, "chapter_1/valid/spaces.c": {"return_code": 0}, "chapter_1/valid/no_newlines.c": {"return_code": 0}, "chapter_13/valid/floating_expressions/logical.c": {"return_code": 0}, "chapter_13/valid/floating_expressions/arithmetic_ops.c": {"return_code": 0}, "chapter_13/valid/floating_expressions/static_initialized_double.c": {"return_code": 0}, "chapter_13/valid/floating_expressions/comparisons.c": {"return_code": 0}, "chapter_13/valid/floating_expressions/simple.c": {"return_code": 1}, "chapter_13/valid/floating_expressions/loop_controlling_expression.c": {"return_code": 100}, "chapter_13/valid/libraries/double_parameters.c": {"return_code": 0}, "chapter_13/valid/libraries/use_arg_after_fun_call.c": {"return_code": 4}, "chapter_13/valid/libraries/double_and_int_params_recursive.c": {"return_code": 0}, "chapter_13/valid/libraries/extern_double.c": {"return_code": 1}, "chapter_13/valid/libraries/double_params_and_result.c": {"return_code": 1}, "chapter_13/valid/explicit_casts/cvttsd2i_rewrite.c": {"return_code": 0}, "chapter_13/valid/explicit_casts/double_to_signed.c": {"return_code": 0}, "chapter_13/valid/explicit_casts/unsigned_to_double.c": {"return_code": 0}, "chapter_13/valid/explicit_casts/signed_to_double.c": {"return_code": 0}, "chapter_13/valid/explicit_casts/double_to_unsigned.c": {"return_code": 0}, "chapter_13/valid/implicit_casts/convert_for_assignment.c": {"return_code": 0}, "chapter_13/valid/implicit_casts/common_type.c": {"return_code": 0}, "chapter_13/valid/implicit_casts/static_initializers.c": {"return_code": 0}, "chapter_13/valid/implicit_casts/complex_arithmetic_common_type.c": {"return_code": 1}, "chapter_13/valid/constants/round_constants.c": {"return_code": 0}, "chapter_13/valid/constants/constant_doubles.c": {"return_code": 0}, "chapter_13/valid/special_values/subnormal_not_zero.c": {"return_code": 0}, "chapter_13/valid/special_values/negative_zero.c": {"return_code": 0}, "chapter_13/valid/special_values/infinity.c": {"return_code": 0}, "chapter_13/valid/function_calls/double_parameters.c": {"return_code": 0}, "chapter_13/valid/function_calls/double_and_int_parameters.c": {"return_code": 0}, "chapter_13/valid/function_calls/standard_library_call.c": {"return_code": 0}, "chapter_13/valid/function_calls/use_arg_after_fun_call.c": {"return_code": 4}, "chapter_13/valid/function_calls/return_double.c": {"return_code": 1}, "chapter_13/valid/function_calls/double_and_int_params_recursive.c": {"return_code": 0}, "chapter_13/valid/extra_credit/compound_assign.c": {"return_code": 1}, "chapter_13/valid/extra_credit/nan.c": {"return_code": 0}, "chapter_13/valid/extra_credit/compound_assign_implicit_cast.c": {"return_code": 1}, "chapter_18/valid/params_and_returns/pass_and_return_struct.c": {"return_code": 11}, "chapter_18/valid/params_and_returns/temporary_lifetime.c": {"return_code": 1}, "chapter_18/valid/params_and_returns/return_struct_on_page_boundary.c": {"return_code": 0}, "chapter_18/valid/params_and_returns/return_incomplete_type.c": {"return_code": 1}, "chapter_18/valid/params_and_returns/cast_struct_to_void.c": {"return_code": 2}, "chapter_18/valid/params_and_returns/return_struct.c": {"return_code": 11}, "chapter_18/valid/params_and_returns/libraries/return_calling_conventions.c": {"return_code": 0}, "chapter_18/valid/params_and_returns/libraries/pass_wonky_struct.c": {"return_code": 0}, "chapter_18/valid/params_and_returns/libraries/missing_retval.c": {"return_code": 1}, "chapter_18/valid/params_and_returns/libraries/retval_struct_sizes.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/pass_pointer_to_struct.c": {"return_code": 112}, "chapter_18/valid/no_structure_parameters/typecheck/deref_incomplete_var.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/typecheck/conditional_struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/typecheck/block_scope_forward_decl.c": {"return_code": 3}, "chapter_18/valid/no_structure_parameters/typecheck/define_then_declare.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/typecheck/incomplete_var_completed.c": {"return_code": 100}, "chapter_18/valid/no_structure_parameters/typecheck/file_scope_forward_decl.c": {"return_code": 2}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/copy_struct_with_array_2.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/load_test.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/copy_struct_into_member.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/copy_struct.c": {"return_code": 7}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/array_of_structs_padding.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/array_of_structs.c": {"return_code": 19}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/copy_from_offset_test.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/struct_copy_tests/copy_struct_with_array.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/global_struct.c": {"return_code": 7}, "chapter_18/valid/no_structure_parameters/member_access_tests/deref_arrow.c": {"return_code": 3}, "chapter_18/valid/no_structure_parameters/member_access_tests/linked_list.c": {"return_code": 30}, "chapter_18/valid/no_structure_parameters/member_access_tests/assign_to_struct.c": {"return_code": 10}, "chapter_18/valid/no_structure_parameters/member_access_tests/pointer_to_struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/get_array_through_pointer.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/nested_struct.c": {"return_code": 16}, "chapter_18/valid/no_structure_parameters/member_access_tests/addr_of_arrow.c": {"return_code": 10}, "chapter_18/valid/no_structure_parameters/member_access_tests/copy_from_pointer.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/static_struct.c": {"return_code": 19}, "chapter_18/valid/no_structure_parameters/member_access_tests/global_nested_struct.c": {"return_code": 8}, "chapter_18/valid/no_structure_parameters/member_access_tests/non_static_struct.c": {"return_code": 9}, "chapter_18/valid/no_structure_parameters/member_access_tests/get_member_addresses.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/member_access_tests/nested_address_calculations.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/member_access_tests/aggregate_through_arrow.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/member_access_tests/copy_to_pointer.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/member_access_tests/assign_to_struct_pointer.c": {"return_code": 10}, "chapter_18/valid/no_structure_parameters/libraries/global_struct.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/libraries/initializers.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/libraries/incomplete_var.c": {"return_code": 5}, "chapter_18/valid/no_structure_parameters/libraries/nested_pointer_access.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/sizeof/sizeof_wonky.c": {"return_code": 19}, "chapter_18/valid/no_structure_parameters/sizeof/sizeof_struct.c": {"return_code": 8}, "chapter_18/valid/no_structure_parameters/sizeof/sizeof_padded.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/parse_and_lex/postfix_precedence.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/parse_and_lex/space_around_struct_member.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/parse_and_lex/struct_member_looks_like_const.c": {"return_code": 3}, "chapter_18/valid/no_structure_parameters/initializers/nested_struct_init.c": {"return_code": 157}, "chapter_18/valid/no_structure_parameters/initializers/mixed_initialization.c": {"return_code": 7}, "chapter_18/valid/no_structure_parameters/initializers/load_addr_in_init.c": {"return_code": 6}, "chapter_18/valid/no_structure_parameters/initializers/partial_struct_init.c": {"return_code": 26}, "chapter_18/valid/no_structure_parameters/initializers/string_in_global_struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/initializers/string_in_struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/scoping_tests/scoped_struct.c": {"return_code": 2}, "chapter_18/valid/no_structure_parameters/scoping_tests/resolve_tag_for_loop_decl.c": {"return_code": 10}, "chapter_18/valid/no_structure_parameters/scoping_tests/same_tag_name.c": {"return_code": 8}, "chapter_18/valid/no_structure_parameters/scoping_tests/resolve_tags_derived_types.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/scoping_tests/different_namespaces_same_ids.c": {"return_code": 10}, "chapter_18/valid/no_structure_parameters/scoping_tests/resolve_tag_sizeof.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/scoping_tests/same_tag_name_simple.c": {"return_code": 4}, "chapter_18/valid/no_structure_parameters/scoping_tests/declare_struct.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/scoping_tests/shared_struct_and_var_names.c": {"return_code": 1}, "chapter_18/valid/parameters/pass_struct_as_arg.c": {"return_code": 1}, "chapter_18/valid/parameters/pass_args_on_page_boundary.c": {"return_code": 15}, "chapter_18/valid/parameters/incomplete_param_type.c": {"return_code": 3}, "chapter_18/valid/parameters/pass_struct_and_other_args.c": {"return_code": 1}, "chapter_18/valid/parameters/libraries/param_calling_conventions.c": {"return_code": 0}, "chapter_18/valid/parameters/libraries/preserve_stack.c": {"return_code": 0}, "chapter_18/valid/parameters/libraries/struct_sizes.c": {"return_code": 0}, "chapter_18/valid/parameters/libraries/pass_struct.c": {"return_code": 2}, "chapter_18/valid/parameters/libraries/array_of_structs.c": {"return_code": 0}, "chapter_15/valid/initialization/automatic.c": {"return_code": 0}, "chapter_15/valid/initialization/static.c": {"return_code": 0}, "chapter_15/valid/initialization/trailing_comma_initializer.c": {"return_code": 3}, "chapter_15/valid/initialization/automatic_nested.c": {"return_code": 0}, "chapter_15/valid/initialization/static_nested.c": {"return_code": 0}, "chapter_15/valid/libraries/set_array_val.c": {"return_code": 0}, "chapter_15/valid/libraries/return_pointer_to_array.c": {"return_code": 0}, "chapter_15/valid/libraries/global_array.c": {"return_code": 0}, "chapter_15/valid/subscripting/subscript_nested.c": {"return_code": 0}, "chapter_15/valid/subscripting/subscript_pointer.c": {"return_code": 0}, "chapter_15/valid/subscripting/array_of_pointers_to_arrays.c": {"return_code": 0}, "chapter_15/valid/subscripting/simple_subscripts.c": {"return_code": 0}, "chapter_15/valid/subscripting/simple.c": {"return_code": 3}, "chapter_15/valid/subscripting/complex_operands.c": {"return_code": 0}, "chapter_15/valid/subscripting/addition_subscript_equivalence.c": {"return_code": 0}, "chapter_15/valid/subscripting/subscript_precedence.c": {"return_code": 1}, "chapter_15/valid/allocation/test_alignment.c": {"return_code": 0}, "chapter_15/valid/pointer_arithmetic/pointer_add.c": {"return_code": 0}, "chapter_15/valid/pointer_arithmetic/add_dereference_and_assign.c": {"return_code": 0}, "chapter_15/valid/pointer_arithmetic/pointer_diff.c": {"return_code": 0}, "chapter_15/valid/pointer_arithmetic/compare.c": {"return_code": 0}, "chapter_15/valid/extra_credit/incr_ptr.c": {"return_code": 1}, "chapter_15/valid/declarators/big_array.c": {"return_code": 0}, "chapter_15/valid/declarators/equivalent_declarators.c": {"return_code": 0}, "chapter_15/valid/declarators/return_nested_array.c": {"return_code": 0}, "chapter_15/valid/declarators/array_as_argument.c": {"return_code": 0}, "chapter_15/valid/declarators/for_loop_array.c": {"return_code": 0}, "chapter_15/valid/casts/multi_dim_casts.c": {"return_code": 0}, "chapter_15/valid/casts/implicit_and_explicit_conversions.c": {"return_code": 0}, "chapter_15/valid/casts/cast_array_of_pointers.c": {"return_code": 1}, "chapter_17/valid/void/cast_to_void.c": {"return_code": 12}, "chapter_17/valid/void/void_function.c": {"return_code": 0}, "chapter_17/valid/void/void_for_loop.c": {"return_code": 0, "stdout": "ZYXWVUTSRQPONMLKJIHGFEDCBAABCDEFGHIJKLMNOPQRSTUVWXYZZYXWVUTSRQPONMLKJIHGFEDCBA"}, "chapter_17/valid/void/ternary.c": {"return_code": 0}, "chapter_17/valid/libraries/pass_alloced_memory.c": {"return_code": 0}, "chapter_17/valid/libraries/test_for_memory_leaks.c": {"return_code": 0}, "chapter_17/valid/libraries/sizeof_extern.c": {"return_code": 1}, "chapter_17/valid/sizeof/sizeof_basic_types.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_consts.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_expressions.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_array.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_derived_types.c": {"return_code": 0}, "chapter_17/valid/sizeof/simple.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_result_is_ulong.c": {"return_code": 0}, "chapter_17/valid/sizeof/sizeof_not_evaluated.c": {"return_code": 4}, "chapter_17/valid/void_pointer/array_of_pointers_to_void.c": {"return_code": 0}, "chapter_17/valid/void_pointer/conversion_by_assignment.c": {"return_code": 0}, "chapter_17/valid/void_pointer/explicit_cast.c": {"return_code": 0}, "chapter_17/valid/void_pointer/simple.c": {"return_code": 100}, "chapter_17/valid/void_pointer/memory_management_functions.c": {"return_code": 0}, "chapter_17/valid/void_pointer/common_pointer_type.c": {"return_code": 0}, "chapter_16/valid/strings_as_lvalues/addr_of_string.c": {"return_code": 0, "stdout": "Sample\tstring!\n\n"}, "chapter_16/valid/strings_as_lvalues/standard_library_calls.c": {"return_code": 0, "stdout": "Hello, World!\n"}, "chapter_16/valid/strings_as_lvalues/array_of_strings.c": {"return_code": 0}, "chapter_16/valid/strings_as_lvalues/cast_string_pointer.c": {"return_code": 0}, "chapter_16/valid/strings_as_lvalues/empty_string.c": {"return_code": 0}, "chapter_16/valid/strings_as_lvalues/pointer_operations.c": {"return_code": 0}, "chapter_16/valid/strings_as_lvalues/simple.c": {"return_code": 108}, "chapter_16/valid/strings_as_lvalues/adjacent_strings.c": {"return_code": 0, "stdout": "Hello, World\n"}, "chapter_16/valid/strings_as_lvalues/string_special_characters.c": {"return_code": 0, "stdout": "Hello\"world\nHello\\World\nLine\nbreak!\nTesting, 123.\n^@1 _\\]\n"}, "chapter_16/valid/strings_as_lvalues/strings_in_function_calls.c": {"return_code": 0}, "chapter_16/valid/libraries/return_char.c": {"return_code": 0}, "chapter_16/valid/libraries/char_arguments.c": {"return_code": 0}, "chapter_16/valid/libraries/global_char.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/array_init_special_chars.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/terminating_null_bytes.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/simple.c": {"return_code": 99}, "chapter_16/valid/strings_as_initializers/partial_initialize_via_string.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/adjacent_strings_in_initializer.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/transfer_by_eightbyte.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/literals_and_compound_initializers.c": {"return_code": 0}, "chapter_16/valid/strings_as_initializers/write_to_array.c": {"return_code": 0, "stdout": "abc\nabx\nHello\nWorld\nJello\n"}, "chapter_16/valid/strings_as_initializers/test_alignment.c": {"return_code": 0}, "chapter_16/valid/char_constants/return_char_constant.c": {"return_code": 99}, "chapter_16/valid/char_constants/escape_sequences.c": {"return_code": 0}, "chapter_16/valid/char_constants/control_characters.c": {"return_code": 0}, "chapter_16/valid/char_constants/char_constant_operations.c": {"return_code": 0}, "chapter_16/valid/chars/partial_initialization.c": {"return_code": 0}, "chapter_16/valid/chars/convert_by_assignment.c": {"return_code": 0}, "chapter_16/valid/chars/type_specifiers.c": {"return_code": 0}, "chapter_16/valid/chars/push_arg_on_page_boundary.c": {"return_code": 1}, "chapter_16/valid/chars/integer_promotion.c": {"return_code": 0}, "chapter_16/valid/chars/chained_casts.c": {"return_code": 0}, "chapter_16/valid/chars/return_char.c": {"return_code": 0}, "chapter_16/valid/chars/char_arguments.c": {"return_code": 0}, "chapter_16/valid/chars/char_expressions.c": {"return_code": 0}, "chapter_16/valid/chars/access_through_char_pointer.c": {"return_code": 0}, "chapter_16/valid/chars/common_type.c": {"return_code": 0}, "chapter_16/valid/chars/static_initializers.c": {"return_code": 0}, "chapter_16/valid/chars/explicit_casts.c": {"return_code": 0}, "chapter_9/valid/arguments_in_registers/parameter_shadows_own_function.c": {"return_code": 2}, "chapter_9/valid/arguments_in_registers/expression_args.c": {"return_code": 2}, "chapter_9/valid/arguments_in_registers/single_arg.c": {"return_code": 6}, "chapter_9/valid/arguments_in_registers/hello_world.c": {"return_code": 0, "stdout": "Hello, World!\n"}, "chapter_9/valid/arguments_in_registers/parameter_shadows_function.c": {"return_code": 3}, "chapter_9/valid/arguments_in_registers/parameters_are_preserved.c": {"return_code": 1}, "chapter_9/valid/arguments_in_registers/forward_decl_multi_arg.c": {"return_code": 1}, "chapter_9/valid/arguments_in_registers/fibonacci.c": {"return_code": 8}, "chapter_9/valid/arguments_in_registers/param_shadows_local_var.c": {"return_code": 20}, "chapter_9/valid/no_arguments/function_shadows_variable.c": {"return_code": 11}, "chapter_9/valid/no_arguments/use_function_in_expression.c": {"return_code": 21}, "chapter_9/valid/no_arguments/no_return_value.c": {"return_code": 3}, "chapter_9/valid/no_arguments/multiple_declarations.c": {"return_code": 3}, "chapter_9/valid/no_arguments/precedence.c": {"return_code": 0}, "chapter_9/valid/no_arguments/forward_decl.c": {"return_code": 3}, "chapter_9/valid/no_arguments/variable_shadows_function.c": {"return_code": 7}, "chapter_9/valid/libraries/system_call.c": {"return_code": 0, "stdout": "H"}, "chapter_9/valid/libraries/many_args.c": {"return_code": 115}, "chapter_9/valid/libraries/addition.c": {"return_code": 3}, "chapter_9/valid/libraries/no_function_calls/division.c": {"return_code": 1}, "chapter_9/valid/libraries/no_function_calls/local_stack_variables.c": {"return_code": 100}, "chapter_9/valid/extra_credit/compound_assign_function_result.c": {"return_code": 1}, "chapter_9/valid/extra_credit/goto_label_multiple_functions.c": {"return_code": 5}, "chapter_9/valid/extra_credit/goto_shared_name.c": {"return_code": 1}, "chapter_9/valid/stack_arguments/call_putchar.c": {"return_code": 8, "stdout": "A"}, "chapter_9/valid/stack_arguments/lots_of_arguments.c": {"return_code": 1}, "chapter_9/valid/stack_arguments/stack_alignment.c": {"return_code": 1}, "chapter_9/valid/stack_arguments/test_for_memory_leaks.c": {"return_code": 1}, "chapter_12/valid/unsigned_expressions/logical.c": {"return_code": 0}, "chapter_12/valid/unsigned_expressions/arithmetic_wraparound.c": {"return_code": 1}, "chapter_12/valid/unsigned_expressions/arithmetic_ops.c": {"return_code": 0}, "chapter_12/valid/unsigned_expressions/comparisons.c": {"return_code": 0}, "chapter_12/valid/unsigned_expressions/simple.c": {"return_code": 1}, "chapter_12/valid/unsigned_expressions/static_variables.c": {"return_code": 1}, "chapter_12/valid/unsigned_expressions/locals.c": {"return_code": 0}, "chapter_12/valid/libraries/unsigned_args.c": {"return_code": 0}, "chapter_12/valid/libraries/unsigned_global_var.c": {"return_code": 1}, "chapter_12/valid/explicit_casts/same_size_conversion.c": {"return_code": 0}, "chapter_12/valid/explicit_casts/extension.c": {"return_code": 0}, "chapter_12/valid/explicit_casts/round_trip_casts.c": {"return_code": 0}, "chapter_12/valid/explicit_casts/chained_casts.c": {"return_code": 0}, "chapter_12/valid/explicit_casts/truncate.c": {"return_code": 0}, "chapter_12/valid/type_specifiers/signed_type_specifiers.c": {"return_code": 0}, "chapter_12/valid/type_specifiers/unsigned_type_specifiers.c": {"return_code": 0}, "chapter_12/valid/implicit_casts/convert_by_assignment.c": {"return_code": 0}, "chapter_12/valid/implicit_casts/promote_constants.c": {"return_code": 0}, "chapter_12/valid/implicit_casts/common_type.c": {"return_code": 0}, "chapter_12/valid/implicit_casts/static_initializers.c": {"return_code": 0}, "chapter_12/valid/extra_credit/switch_uint.c": {"return_code": 0}, "chapter_12/valid/extra_credit/compound_assign_uint.c": {"return_code": 1}, "chapter_12/valid/extra_credit/bitwise_unsigned_shift.c": {"return_code": 1}, "chapter_12/valid/extra_credit/bitwise_unsigned_ops.c": {"return_code": 1}, "chapter_5/valid/null_then_return.c": {"return_code": 0}, "chapter_5/valid/empty_function_body.c": {"return_code": 0}, "chapter_5/valid/short_circuit_or.c": {"return_code": 0}, "chapter_5/valid/assignment_in_initializer.c": {"return_code": 0}, "chapter_5/valid/non_short_circuit_or.c": {"return_code": 1}, "chapter_5/valid/null_statement.c": {"return_code": 0}, "chapter_5/valid/short_circuit_and_fail.c": {"return_code": 0}, "chapter_5/valid/local_var_missing_return.c": {"return_code": 0}, "chapter_5/valid/exp_then_declaration.c": {"return_code": 1}, "chapter_5/valid/add_variables.c": {"return_code": 3}, "chapter_5/valid/assign_val_in_initializer.c": {"return_code": 5}, "chapter_5/valid/assignment_lowest_precedence.c": {"return_code": 1}, "chapter_5/valid/allocate_temps_and_vars.c": {"return_code": 1}, "chapter_5/valid/use_assignment_result.c": {"return_code": 4}, "chapter_5/valid/use_val_in_own_initializer.c": {"return_code": 0}, "chapter_5/valid/unused_exp.c": {"return_code": 0}, "chapter_5/valid/return_var.c": {"return_code": 2}, "chapter_5/valid/mixed_precedence_assignment.c": {"return_code": 4}, "chapter_5/valid/assign.c": {"return_code": 2}, "chapter_5/valid/extra_credit/bitwise_shiftr_assign.c": {"return_code": 77}, "chapter_5/valid/extra_credit/bitwise_shiftl_variable.c": {"return_code": 24}, "chapter_5/valid/extra_credit/compound_bitwise_and.c": {"return_code": 2}, "chapter_5/valid/extra_credit/compound_minus.c": {"return_code": 2}, "chapter_5/valid/extra_credit/compound_multiply.c": {"return_code": 12}, "chapter_5/valid/extra_credit/compound_bitwise_xor.c": {"return_code": 2}, "chapter_5/valid/extra_credit/compound_bitwise_or.c": {"return_code": 31}, "chapter_5/valid/extra_credit/compound_assignment_chained.c": {"return_code": 4}, "chapter_5/valid/extra_credit/compound_divide.c": {"return_code": 2}, "chapter_5/valid/extra_credit/compound_bitwise_shiftr.c": {"return_code": 102}, "chapter_5/valid/extra_credit/compound_assignment_use_result.c": {"return_code": 8}, "chapter_5/valid/extra_credit/compound_bitwise_shiftl.c": {"return_code": 48}, "chapter_5/valid/extra_credit/compound_plus.c": {"return_code": 4}, "chapter_5/valid/extra_credit/compound_mod.c": {"return_code": 2}, "chapter_5/valid/extra_credit/bitwise_and_vars.c": {"return_code": 1}, "chapter_7/valid/declaration_only.c": {"return_code": 1}, "chapter_7/valid/assign_to_self_2.c": {"return_code": 3}, "chapter_7/valid/hidden_then_visible.c": {"return_code": 1}, "chapter_7/valid/hidden_variable.c": {"return_code": 1}, "chapter_7/valid/assign_to_self.c": {"return_code": 4}, "chapter_7/valid/inner_uninitialized.c": {"return_code": 4}, "chapter_7/valid/multiple_vars_same_name.c": {"return_code": 2}, "chapter_7/valid/use_in_inner_scope.c": {"return_code": 3}, "chapter_7/valid/empty_blocks.c": {"return_code": 30}, "chapter_7/valid/nested_if.c": {"return_code": 1}, "chapter_7/valid/similar_var_names.c": {"return_code": 28}, "chapter_7/valid/extra_credit/goto_before_declaration.c": {"return_code": 0}, "chapter_7/valid/extra_credit/compound_subtract_in_block.c": {"return_code": 1}, "chapter_7/valid/extra_credit/goto_inner_scope.c": {"return_code": 1}, "chapter_4/valid/le_true.c": {"return_code": 2}, "chapter_4/valid/ne_true.c": {"return_code": 1}, "chapter_4/valid/ge_false.c": {"return_code": 0}, "chapter_4/valid/not_zero.c": {"return_code": 1}, "chapter_4/valid/precedence_2.c": {"return_code": 0}, "chapter_4/valid/ge_true.c": {"return_code": 2}, "chapter_4/valid/eq_precedence.c": {"return_code": 1}, "chapter_4/valid/eq_false.c": {"return_code": 0}, "chapter_4/valid/or_short_circuit.c": {"return_code": 1}, "chapter_4/valid/not_sum.c": {"return_code": 1}, "chapter_4/valid/precedence_4.c": {"return_code": 1}, "chapter_4/valid/and_short_circuit.c": {"return_code": 0}, "chapter_4/valid/precedence_3.c": {"return_code": 0}, "chapter_4/valid/compare_arithmetic_results.c": {"return_code": 1}, "chapter_4/valid/and_false.c": {"return_code": 0}, "chapter_4/valid/precedence_5.c": {"return_code": 1}, "chapter_4/valid/associativity.c": {"return_code": 1}, "chapter_4/valid/gt_true.c": {"return_code": 1}, "chapter_4/valid/lt_false.c": {"return_code": 0}, "chapter_4/valid/or_true.c": {"return_code": 3}, "chapter_4/valid/or_false.c": {"return_code": 0}, "chapter_4/valid/eq_true.c": {"return_code": 1}, "chapter_4/valid/ne_false.c": {"return_code": 0}, "chapter_4/valid/multi_short_circuit.c": {"return_code": 0}, "chapter_4/valid/gt_false.c": {"return_code": 0}, "chapter_4/valid/operate_on_booleans.c": {"return_code": 0}, "chapter_4/valid/not.c": {"return_code": 0}, "chapter_4/valid/le_false.c": {"return_code": 0}, "chapter_4/valid/nested_ops.c": {"return_code": 0}, "chapter_4/valid/precedence.c": {"return_code": 1}, "chapter_4/valid/not_sum_2.c": {"return_code": 0}, "chapter_4/valid/and_true.c": {"return_code": 1}, "chapter_4/valid/lt_true.c": {"return_code": 1}, "chapter_4/valid/extra_credit/bitwise_precedence.c": {"return_code": 1}, "chapter_3/valid/mod.c": {"return_code": 0}, "chapter_3/valid/unop_add.c": {"return_code": 0}, "chapter_3/valid/associativity_3.c": {"return_code": 8}, "chapter_3/valid/mult.c": {"return_code": 6}, "chapter_3/valid/sub.c": {"return_code": 255}, "chapter_3/valid/div_neg.c": {"return_code": 254}, "chapter_3/valid/unop_parens.c": {"return_code": 253}, "chapter_3/valid/add.c": {"return_code": 3}, "chapter_3/valid/associativity.c": {"return_code": 252}, "chapter_3/valid/associativity_2.c": {"return_code": 1}, "chapter_3/valid/div.c": {"return_code": 2}, "chapter_3/valid/sub_neg.c": {"return_code": 3}, "chapter_3/valid/associativity_and_precedence.c": {"return_code": 10}, "chapter_3/valid/parens.c": {"return_code": 14}, "chapter_3/valid/precedence.c": {"return_code": 14}, "chapter_3/valid/extra_credit/bitwise_shiftr.c": {"return_code": 62}, "chapter_3/valid/extra_credit/bitwise_and.c": {"return_code": 1}, "chapter_3/valid/extra_credit/bitwise_shiftl.c": {"return_code": 140}, "chapter_3/valid/extra_credit/bitwise_or.c": {"return_code": 3}, "chapter_3/valid/extra_credit/bitwise_shift_precedence.c": {"return_code": 0}, "chapter_3/valid/extra_credit/bitwise_xor.c": {"return_code": 6}, "chapter_3/valid/extra_credit/bitwise_shift_associativity_2.c": {"return_code": 16}, "chapter_3/valid/extra_credit/bitwise_shift_associativity.c": {"return_code": 66}, "chapter_3/valid/extra_credit/bitwise_precedence.c": {"return_code": 21}, "chapter_11/valid/long_expressions/long_args.c": {"return_code": 0}, "chapter_11/valid/long_expressions/logical.c": {"return_code": 0}, "chapter_11/valid/long_expressions/type_specifiers.c": {"return_code": 0}, "chapter_11/valid/long_expressions/multi_op.c": {"return_code": 1}, "chapter_11/valid/long_expressions/large_constants.c": {"return_code": 0}, "chapter_11/valid/long_expressions/arithmetic_ops.c": {"return_code": 0}, "chapter_11/valid/long_expressions/return_long.c": {"return_code": 1}, "chapter_11/valid/long_expressions/comparisons.c": {"return_code": 0}, "chapter_11/valid/long_expressions/simple.c": {"return_code": 1}, "chapter_11/valid/long_expressions/static_long.c": {"return_code": 1}, "chapter_11/valid/long_expressions/long_and_int_locals.c": {"return_code": 0}, "chapter_11/valid/long_expressions/assign.c": {"return_code": 1}, "chapter_11/valid/libraries/long_args.c": {"return_code": 0}, "chapter_11/valid/libraries/maintain_stack_alignment.c": {"return_code": 12}, "chapter_11/valid/libraries/return_long.c": {"return_code": 1}, "chapter_11/valid/libraries/long_global_var.c": {"return_code": 0}, "chapter_11/valid/explicit_casts/truncate.c": {"return_code": 0}, "chapter_11/valid/explicit_casts/sign_extend.c": {"return_code": 0}, "chapter_11/valid/implicit_casts/convert_by_assignment.c": {"return_code": 0}, "chapter_11/valid/implicit_casts/common_type.c": {"return_code": 0}, "chapter_11/valid/implicit_casts/long_constants.c": {"return_code": 0}, "chapter_11/valid/implicit_casts/convert_function_arguments.c": {"return_code": 0}, "chapter_11/valid/implicit_casts/convert_static_initializer.c": {"return_code": 0}, "chapter_11/valid/extra_credit/bitwise_long_op.c": {"return_code": 1}, "chapter_11/valid/extra_credit/compound_assign_to_int.c": {"return_code": 1}, "chapter_11/valid/extra_credit/compound_assign_to_long.c": {"return_code": 1}, "chapter_11/valid/extra_credit/switch_int.c": {"return_code": 1}, "chapter_11/valid/extra_credit/switch_long.c": {"return_code": 1}, "chapter_19/whole_pipeline/all_types/alias_analysis_change.c": {"return_code": 0}, "chapter_19/whole_pipeline/int_only/dead_condition.c": {"return_code": 10}, "chapter_19/whole_pipeline/int_only/elim_and_copy_prop.c": {"return_code": 10}, "chapter_19/whole_pipeline/int_only/remainder_test.c": {"return_code": 1}, "chapter_19/dead_store_elimination/all_types/aliased_dead_at_exit.c": {"return_code": 1}, "chapter_19/dead_store_elimination/all_types/getaddr_doesnt_gen.c": {"return_code": 0}, "chapter_19/dead_store_elimination/all_types/copy_to_dead_struct.c": {"return_code": 4}, "chapter_19/dead_store_elimination/all_types/dont_elim/copytooffset_doesnt_kill.c": {"return_code": 101}, "chapter_19/dead_store_elimination/all_types/dont_elim/store_generates_dst.c": {"return_code": 4}, "chapter_19/dead_store_elimination/all_types/dont_elim/load_generates_pointer.c": {"return_code": 10}, "chapter_19/dead_store_elimination/all_types/dont_elim/load_through_pointer.c": {"return_code": 10}, "chapter_19/dead_store_elimination/all_types/dont_elim/pass_pointer_to_fun.c": {"return_code": 5}, "chapter_19/dead_store_elimination/all_types/dont_elim/never_kill_store.c": {"return_code": 4}, "chapter_19/dead_store_elimination/all_types/dont_elim/copyfromoffset_gen.c": {"return_code": 3}, "chapter_19/dead_store_elimination/int_only/fig_19_12.c": {"return_code": 9}, "chapter_19/dead_store_elimination/int_only/use_and_kill.c": {"return_code": 5}, "chapter_19/dead_store_elimination/int_only/dead_store_static_var.c": {"return_code": 1}, "chapter_19/dead_store_elimination/int_only/loop_dead_store.c": {"return_code": 51}, "chapter_19/dead_store_elimination/int_only/simple.c": {"return_code": 3}, "chapter_19/dead_store_elimination/int_only/elim_second_copy.c": {"return_code": 10}, "chapter_19/dead_store_elimination/int_only/dont_elim/static_vars_at_exit.c": {"return_code": 1}, "chapter_19/dead_store_elimination/int_only/dont_elim/used_one_path.c": {"return_code": 40}, "chapter_19/dead_store_elimination/int_only/dont_elim/dont_remove_funcall.c": {"return_code": 0, "stdout": "C"}, "chapter_19/dead_store_elimination/int_only/dont_elim/add_all_to_worklist.c": {"return_code": 0, "stdout": "L"}, "chapter_19/dead_store_elimination/int_only/dont_elim/loop.c": {"return_code": 54}, "chapter_19/dead_store_elimination/int_only/dont_elim/static_vars_fun.c": {"return_code": 5}, "chapter_19/unreachable_code_elimination/remove_useless_starting_label.c": {"return_code": 99}, "chapter_19/unreachable_code_elimination/dead_for_loop.c": {"return_code": 10}, "chapter_19/unreachable_code_elimination/remove_jnz.c": {"return_code": 1}, "chapter_19/unreachable_code_elimination/dead_branch_inside_loop.c": {"return_code": 19}, "chapter_19/unreachable_code_elimination/empty.c": {"return_code": 0}, "chapter_19/unreachable_code_elimination/constant_if_else.c": {"return_code": 45}, "chapter_19/unreachable_code_elimination/loop_in_dead_branch.c": {"return_code": 0}, "chapter_19/unreachable_code_elimination/dead_after_return.c": {"return_code": 2}, "chapter_19/unreachable_code_elimination/empty_block.c": {"return_code": 1}, "chapter_19/unreachable_code_elimination/dead_after_if_else.c": {"return_code": 1}, "chapter_19/unreachable_code_elimination/dont_elim/keep_final_jump.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_cast_to_double.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_ulong.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_double.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_long.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_uint.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/fold_cast_from_double.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/truncate.c": {"return_code": 0}, "chapter_19/constant_folding/all_types/zero_and_sign_extend.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_divide_by_zero.c": {"return_code": 1}, "chapter_19/constant_folding/int_only/fold_unary.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_dead_branch.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_conditional_jump.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_comparisons.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_arithmetic.c": {"return_code": 0}, "chapter_19/constant_folding/int_only/fold_overflow.c": {"return_code": 0}, "chapter_19/copy_propagation/all_types/pointer_arithmetic.c": {"return_code": 2}, "chapter_19/copy_propagation/all_types/store_doesnt_kill.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/unsigned_wraparound.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/propagate_doubles.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/unsigned_compare.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/signed_unsigned_conversion.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/char_type_conversion.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/not_char.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/char_round_trip_2.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/alias_analysis.c": {"return_code": 24}, "chapter_19/copy_propagation/all_types/const_fold_sign_extend.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/copy_struct.c": {"return_code": 6}, "chapter_19/copy_propagation/all_types/propagate_null_pointer.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/char_round_trip.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/const_fold_type_conversions.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/const_fold_sign_extend_2.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/dont_propagate/static_are_aliased.c": {"return_code": 8}, "chapter_19/copy_propagation/all_types/dont_propagate/store_kills_aliased.c": {"return_code": 0}, "chapter_19/copy_propagation/all_types/dont_propagate/copy_to_offset.c": {"return_code": 3}, "chapter_19/copy_propagation/all_types/dont_propagate/dont_propagate_addr_of.c": {"return_code": 0}, "chapter_19/copy_propagation/all_types/dont_propagate/type_conversion.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/dont_propagate/zero_neg_zero_different.c": {"return_code": 1}, "chapter_19/copy_propagation/all_types/dont_propagate/funcall_kills_aliased.c": {"return_code": 2}, "chapter_19/copy_propagation/int_only/propagate_fun_args.c": {"return_code": 220}, "chapter_19/copy_propagation/int_only/killed_then_redefined.c": {"return_code": 2}, "chapter_19/copy_propagation/int_only/redundant_copies_2.c": {"return_code": 10}, "chapter_19/copy_propagation/int_only/multi_path_no_kill.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/redundant_copies.c": {"return_code": 10}, "chapter_19/copy_propagation/int_only/fig_19_8.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/kill_and_add_copies.c": {"return_code": 14}, "chapter_19/copy_propagation/int_only/multi_instance_same_copy.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/init_all_copies.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/complex_const_fold.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/copy_prop_const_fold.c": {"return_code": 6}, "chapter_19/copy_propagation/int_only/prop_static_var.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/propagate_var.c": {"return_code": 6}, "chapter_19/copy_propagation/int_only/multi_path.c": {"return_code": 6}, "chapter_19/copy_propagation/int_only/loop.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/dont_propagate/source_killed_on_one_path.c": {"return_code": 8}, "chapter_19/copy_propagation/int_only/dont_propagate/one_reaching_copy.c": {"return_code": 3}, "chapter_19/copy_propagation/int_only/dont_propagate/listing_20_15.c": {"return_code": 101}, "chapter_19/copy_propagation/int_only/dont_propagate/dest_killed.c": {"return_code": 4}, "chapter_19/copy_propagation/int_only/dont_propagate/no_copies_reach_entry.c": {"return_code": 4}, "chapter_19/copy_propagation/int_only/dont_propagate/add_all_blocks_to_worklist.c": {"return_code": 4}, "chapter_19/copy_propagation/int_only/dont_propagate/multi_values.c": {"return_code": 7}, "chapter_19/copy_propagation/int_only/dont_propagate/static_dst_killed.c": {"return_code": 4}, "chapter_19/copy_propagation/int_only/dont_propagate/static_src_killed.c": {"return_code": 1}, "chapter_19/copy_propagation/int_only/dont_propagate/source_killed.c": {"return_code": 10}, "chapter_20/all_types/no_coalescing/mixed_ints.c": {"return_code": 9}, "chapter_20/all_types/no_coalescing/dbl_trivially_colorable.c": {"return_code": 3}, "chapter_20/all_types/no_coalescing/spill_movz_dst.c": {"return_code": 29}, "chapter_20/all_types/no_coalescing/push_xmm.c": {"return_code": 1}, "chapter_20/all_types/no_coalescing/dbl_fun_call.c": {"return_code": 1}, "chapter_20/all_types/no_coalescing/stack_alignment.c": {"return_code": 1}, "chapter_20/all_types/no_coalescing/track_dbl_arg_registers.c": {"return_code": 1}, "chapter_20/all_types/no_coalescing/fourteen_pseudos_interfere.c": {"return_code": 0}, "chapter_20/all_types/no_coalescing/div_interference.c": {"return_code": 1}, "chapter_20/all_types/no_coalescing/test_spilling_dbls.c": {"return_code": 3}, "chapter_20/all_types/no_coalescing/store_pointer_in_register.c": {"return_code": 0}, "chapter_20/int_only/no_coalescing/same_instr_interference.c": {"return_code": 6}, "chapter_20/int_only/no_coalescing/spills_rewrites_compare.c": {"return_code": 3}, "chapter_20/int_only/no_coalescing/copy_and_separate_interference.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/spills_and_rewrites.c": {"return_code": 23}, "chapter_20/int_only/no_coalescing/cmp_liveness.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/rewrite_large_multiply.c": {"return_code": 58}, "chapter_20/int_only/no_coalescing/spill_callee_saved.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/test_spill_metric.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/unary_interference.c": {"return_code": 10}, "chapter_20/int_only/no_coalescing/optimistic_coloring.c": {"return_code": 0}, "chapter_20/int_only/no_coalescing/track_arg_registers.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/many_pseudos_fewer_conflicts.c": {"return_code": 0}, "chapter_20/int_only/no_coalescing/same_instr_no_interference.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/copy_no_interference.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/force_spill.c": {"return_code": 9}, "chapter_20/int_only/no_coalescing/callee_saved_stack_alignment.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/idiv_interference.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/preserve_across_fun_call.c": {"return_code": 0}, "chapter_20/int_only/no_coalescing/use_all_hardregs.c": {"return_code": 0}, "chapter_20/int_only/no_coalescing/test_spill_metric_2.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/loop.c": {"return_code": 6}, "chapter_20/int_only/no_coalescing/trivially_colorable.c": {"return_code": 1}, "chapter_20/int_only/no_coalescing/cdq_interference.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/cdq_generates_ax.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/callee_saved_live_at_exit.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/coalesce_prevents_spill.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/george_coalesce.c": {"return_code": 1}, "chapter_20/int_only/with_coalescing/unary_generates_dst.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/briggs_coalesce.c": {"return_code": 2}, "chapter_20/int_only/with_coalescing/bin_generates_dst.c": {"return_code": 187}, "chapter_20/int_only/with_coalescing/briggs_coalesce_tmps.c": {"return_code": 1}, "chapter_20/int_only/with_coalescing/cmp_generates_operands.c": {"return_code": 1}, "chapter_20/int_only/with_coalescing/funcall_generates_args.c": {"return_code": 0}, "chapter_20/int_only/with_coalescing/eax_live_at_exit.c": {"return_code": 1}, "chapter_18/valid/no_structure_parameters/semantic_analysis/resolve_tags.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/semantic_analysis/namespaces.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/semantic_analysis/incomplete_structs.c": {"return_code": 0, "stdout": "I'm a struct!\n"}, "chapter_18/valid/no_structure_parameters/semantic_analysis/cast_struct_to_void.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/libraries/param_struct_pointer.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/libraries/return_struct_pointer.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/libraries/opaque_struct.c": {"return_code": 0, "stdout": "new struct\nstatic struct\nglobal struct\n"}, "chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/libraries/initializers/static_struct_initializers.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/libraries/initializers/nested_static_struct_initializers.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/libraries/initializers/nested_auto_struct_initializers.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/smoke_tests/static_vs_auto.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/smoke_tests/simple.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/size_and_offset_calculations/member_offsets.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/size_and_offset_calculations/sizeof_exps.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/size_and_offset_calculations/sizeof_type.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/scalar_member_access/arrow.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/scalar_member_access/linked_list.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/scalar_member_access/static_structs.c": {"return_code": 0, "stdout": "zero\nmn\nop\nwx\nyz\nBCD\nCDE\nDEF\nEFG\nbcd\ncde\n"}, "chapter_18/valid/no_structure_parameters/scalar_member_access/nested_struct.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/scalar_member_access/dot.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/parse_and_lex/trailing_comma.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/struct_copy/load_test.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/struct_copy/copy_struct_through_pointer.c": {"return_code": 7}, "chapter_18/valid/no_structure_parameters/struct_copy/copy_struct_with_arrow_operator.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/struct_copy/copy_struct.c": {"return_code": 0}, "chapter_18/valid/no_structure_parameters/struct_copy/copy_struct_with_dot_operator.c": {"return_code": 0}} \ No newline at end of file diff --git a/generate_expected_results.py b/generate_expected_results.py index 87d44678..9d2d0fae 100755 --- a/generate_expected_results.py +++ b/generate_expected_results.py @@ -57,7 +57,7 @@ def main() -> None: parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group() - group.add_argument("--since_commit", default=None) + group.add_argument("--since-commit", default=None) group.add_argument("--all", action="store_true") args = parser.parse_args() @@ -160,7 +160,6 @@ def main() -> None: result = basic.gcc_compile_and_run(source_files, opts) # record the result - result_dict: dict[str, Any] = {"return_code": result.returncode} if result.stdout: result_dict["stdout"] = result.stdout diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/global_struct.c b/tests/chapter_18/valid/no_structure_parameters/libraries/global_struct.c index 1e223704..65d7f987 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/global_struct.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/global_struct.c @@ -3,7 +3,7 @@ #include "global_struct.h" void update_struct(void) { - global.arr[1] = global.arr[0]*2; + global.arr[1] = global.arr[0] * 2; global.d = 5.0; } diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/global_struct_client.c b/tests/chapter_18/valid/no_structure_parameters/libraries/global_struct_client.c index f6a65eab..ca51a647 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/global_struct_client.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/global_struct_client.c @@ -15,7 +15,7 @@ int main(void) { if (global.arr[1] != 4) { return 1; } - if (global.d != 4.0) { + if (global.d != 5.0) { return 2; } diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers.c b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers.c index 2e87223c..45ebcbec 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers.c @@ -11,7 +11,8 @@ int validate_full_initialization(struct s *ptr) { if (strcmp(ptr->one_msg, "I'm a struct!") || ptr->two_arr[0] != 's' || ptr->two_arr[1] != 'u' || ptr->two_arr[2] != 'p' || - ptr->three_self_ptr != ptr || ptr->four_d != 2e12 || *ptr->five_d_ptr != 2e12) { + ptr->three_self_ptr != ptr || ptr->four_d != 2e12 || + *ptr->five_d_ptr != 2e12) { return 0; } @@ -56,7 +57,8 @@ int validate_two_structs(struct s *ptr1, struct s *ptr2) { ptr2->two_arr[0] != 'x' || ptr2->two_arr[1] != 'y' || ptr2->three_self_ptr != ptr1 || // ptr2->three_self_ptr is ptr1, not to itself - ptr2->four_d != 150.0 || *ptr1->five_d_ptr != 123.4) { + ptr2->four_d != 150.0 || + *ptr1->five_d_ptr != 123.4) { return 0; } diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers.h b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers.h index f1a0b9f1..6d747a1a 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers.h +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers.h @@ -20,7 +20,6 @@ int strcmp(char *s1, char *s2); void *malloc(unsigned long size); void *calloc(unsigned long nmemb, unsigned long size); - // struct type def struct s { char *one_msg; @@ -30,7 +29,6 @@ struct s { double *five_d_ptr; }; - // validation functions defined in library int validate_full_initialization(struct s *ptr); int validate_partial_initialization(struct s *ptr, char *expected_msg); diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers_client.c b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers_client.c index c6509b96..7e741dfe 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers_client.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/auto_struct_initializers_client.c @@ -8,7 +8,11 @@ #include "auto_struct_initializers.h" -double get_double() { +#ifdef SUPPRESS_WARNINGS +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif + +double get_double(void) { return 2e12; } @@ -17,9 +21,10 @@ int test_full_initialization(void) { struct s full = { // use string literals to initialize both pointers and arrays "I'm a struct!", "sup", - &full, // initialize member with pointer to self - get_double(), // initialize member with result of function call - &(full.four_d) // initialize member with pointer to other member in self + &full, // initialize member with pointer to self + get_double(), // initialize member with result of function call + &(full.four_d) // initialize member with pointer to other member in + // self }; return validate_full_initialization(&full); @@ -57,7 +62,8 @@ int test_implicit_type_conversions(void) { // case 4: initialize with single expression instead of compound initiailizer int test_single_exp_initializer(void) { - struct s s1 = {"Yet another string", "xy", &s1, 150.0}; + double d = 123.4; + struct s s1 = {"Yet another string", "xy", &s1, 150.0, &d}; struct s s2 = s1; return validate_two_structs(&s1, &s2); diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_auto_struct_initializers_client.c b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_auto_struct_initializers_client.c index 3905a41c..cbd3f0f2 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_auto_struct_initializers_client.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_auto_struct_initializers_client.c @@ -7,6 +7,13 @@ #include "nested_auto_struct_initializers.h" +#ifdef SUPPRESS_WARNINGS +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wliteral-conversion" +#endif +#endif + // case 1: fully initialized struct (include some implicit conversions while // we're at it) int test_full_initialization(void) { @@ -28,7 +35,6 @@ int test_partial_initialization(void) { }, "Partial"}; // leave four_d uninitialized - return validate_partial_initialization(&partial); } diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_static_struct_initializers.c b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_static_struct_initializers.c index 60f905f7..22b272ef 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_static_struct_initializers.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_static_struct_initializers.c @@ -18,9 +18,9 @@ int test_uninitialized(void) { } // validate elements in struct inner - if (all_zeros.two_struct.one_i || - all_zeros.two_struct.two_arr[0] | all_zeros.two_struct.two_arr[1] || - all_zeros.two_struct.two_arr[2] || all_zeros.two_struct.three_u) { + if (all_zeros.two_struct.one_i || all_zeros.two_struct.two_arr[0] || + all_zeros.two_struct.two_arr[1] || all_zeros.two_struct.two_arr[2] || + all_zeros.two_struct.three_u) { return 0; } @@ -35,8 +35,6 @@ int test_uninitialized(void) { "Hello!"}; // leave d uninitialized */ int test_partially_initialized(void) { - - // validate elements in struct outer if (partial.one_l != 100l || strcmp(partial.three_msg, "Hello!")) { return 0; @@ -104,7 +102,6 @@ int test_fully_intialized(void) { }; */ int test_implicit_conversions(void) { - // validate elements in struct outer if (converted.one_l != 10l || converted.three_msg != 0 || converted.four_d != 9223372036854777856.0) { @@ -129,7 +126,6 @@ int test_implicit_conversions(void) { {6, {7, "cd", 8}, "Message", 9}}; */ int test_array_of_structs(void) { - // leave last element uninitialized // validate outer members of array element 0 diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_static_struct_initializers_client.c b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_static_struct_initializers_client.c index fb0e8604..689af3cf 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_static_struct_initializers_client.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/nested_static_struct_initializers_client.c @@ -6,6 +6,18 @@ #include "nested_static_struct_initializers.h" + +#ifdef SUPPRESS_WARNINGS +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wconstant-conversion" +#pragma clang diagnostic ignored "-Wimplicit-const-int-float-conversion" +#pragma clang diagnostic ignored "-Wliteral-conversion" +#else +#pragma GCC diagnostic ignored "-Woverflow" +#endif +#endif + // structs defined here // validation functions defined in library diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/static_struct_initializers.c b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/static_struct_initializers.c index 07f1bea9..ef4cfd49 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/static_struct_initializers.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/static_struct_initializers.c @@ -12,7 +12,6 @@ // case 1: struct with no explicit initializer should be all zeros // struct s uninitialized; int test_uninitialized(void) { - // make sure all elements are zero if (uninitialized.one_d || uninitialized.two_msg || uninitialized.three_arr[0] || uninitialized.three_arr[1] || @@ -42,10 +41,11 @@ int test_partially_initialized(void) { // case 3: partially initialized array w/in struct // struct s partial with_array = {3.0, "!", {1}, 2}; int test_partial_inner_init(void) { - // validate explicitly initialzed elements - if (partial_with_array.one_d != 3.0 || strcmp(partial_with_array.two_msg, "!") || - partial_with_array.three_arr[0] != 1 || partial_with_array.four_i != 2) { + if (partial_with_array.one_d != 3.0 || + strcmp(partial_with_array.two_msg, "!") || + partial_with_array.three_arr[0] != 1 || + partial_with_array.four_i != 2) { return 0; } @@ -67,8 +67,6 @@ int test_partial_inner_init(void) { }; */ int test_implicit_conversion(void) { - - // validate elements if (converted.one_d != 1152921504606846976.0 || converted.two_msg || converted.three_arr[0] != 'a' || converted.three_arr[1] != 'b' || diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/static_struct_initializers_client.c b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/static_struct_initializers_client.c index 60da3b14..2e43f499 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/static_struct_initializers_client.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/initializers/static_struct_initializers_client.c @@ -6,6 +6,16 @@ #include "static_struct_initializers.h" +#ifdef SUPPRESS_WARNINGS +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wconstant-conversion" +#pragma clang diagnostic ignored "-Wimplicit-const-int-float-conversion" +#else +#pragma GCC diagnostic ignored "-Woverflow" +#endif +#endif + // case 1: struct with no explicit initializer should be all zeros struct s uninitialized; diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/opaque_struct.c b/tests/chapter_18/valid/no_structure_parameters/libraries/opaque_struct.c index bcdaaa26..feecd38b 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/opaque_struct.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/opaque_struct.c @@ -2,7 +2,18 @@ * the client; this is a common idiom for hiding a library's implementation * details */ +#ifdef SUPPRESS_WARNINGS +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" +#else +#pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch" +#endif +#endif + +// library functoins +int strcmp(char *s1, char *s2); int puts(char *s); +void *malloc(unsigned long size); struct s { int member1; @@ -10,7 +21,6 @@ struct s { char *member3; }; - // make a struct struct s *create_struct(int i, double d, char *s) { struct s *ptr = malloc(sizeof(struct s)); @@ -20,7 +30,6 @@ struct s *create_struct(int i, double d, char *s) { return ptr; } - // modify a struct void increment_struct(struct s *ptr) { ptr->member1 = ptr->member1 + 1; @@ -28,7 +37,6 @@ void increment_struct(struct s *ptr) { ptr->member3 = ptr->member3; } - // read struct members int check_struct(struct s *ptr, int expected_i, double expected_d, char *expected_s) { diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/param_struct_pointer.c b/tests/chapter_18/valid/no_structure_parameters/libraries/param_struct_pointer.c index f86e21d5..6160639f 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/param_struct_pointer.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/param_struct_pointer.c @@ -2,7 +2,9 @@ #include "param_struct_pointer.h" -int access_members_through_pointer(struct outer *ptr, char expected_a, char expected_b, double expected_d, int expected_i) { +int access_members_through_pointer(struct outer *ptr, char expected_a, + char expected_b, double expected_d, + int expected_i) { if (ptr->a != expected_a) { return 0; } @@ -19,10 +21,11 @@ int access_members_through_pointer(struct outer *ptr, char expected_a, char expe return 0; } - return 1; // success + return 1; // success } -void update_members_through_pointer(struct outer *ptr, char a, char b, struct inner *inner_ptr) { +void update_members_through_pointer(struct outer *ptr, char a, char b, + struct inner *inner_ptr) { ptr->a = a; ptr->b = b; ptr->substruct = *inner_ptr; diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/param_struct_pointer_client.c b/tests/chapter_18/valid/no_structure_parameters/libraries/param_struct_pointer_client.c index 0fa023e0..1c1fcea1 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/param_struct_pointer_client.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/param_struct_pointer_client.c @@ -14,5 +14,5 @@ int main(void) { return 2; } - return 0; // success + return 0; // success } \ No newline at end of file diff --git a/tests/chapter_18/valid/no_structure_parameters/libraries/return_struct_pointer_client.c b/tests/chapter_18/valid/no_structure_parameters/libraries/return_struct_pointer_client.c index 2f66dcc2..51b859ee 100644 --- a/tests/chapter_18/valid/no_structure_parameters/libraries/return_struct_pointer_client.c +++ b/tests/chapter_18/valid/no_structure_parameters/libraries/return_struct_pointer_client.c @@ -59,7 +59,6 @@ int test_update_member_thru_retval(void) { return 1; // success } - // case 4: update whole structure member through pointer returned by funcall int test_update_nested_struct_thru_retval(void) { struct inner small = {12.0, 13}; @@ -72,7 +71,7 @@ int test_update_nested_struct_thru_retval(void) { return 0; } - return 1; // success + return 1; // success } int main(void) { diff --git a/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/postfix_precedence.c b/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/postfix_precedence.c index d2e1dbfd..00609302 100644 --- a/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/postfix_precedence.c +++ b/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/postfix_precedence.c @@ -1,19 +1,19 @@ // postfix operators have higher precedence than prefix struct inner { - int inner_arr[3]; + int inner_arr[3]; }; struct outer { - int a; - struct inner b; + int a; + struct inner b; }; int main(void) { - struct outer array[4] = {{1, {{2, 3, 4}}}, - {5, {{6, 7, 8}}}, - {9, {{10, 11, 12}}}, - {13, {{14, 15, 16}}}}; + struct outer array[4] = {{1, {{2, 3, 4}}}, + {5, {{6, 7, 8}}}, + {9, {{10, 11, 12}}}, + {13, {{14, 15, 16}}}}; - int i = -array[2].b.inner_arr[1]; - return i == -11; + int i = -array[2].b.inner_arr[1]; + return i == -11; } \ No newline at end of file diff --git a/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/space_around_struct_member.c b/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/space_around_struct_member.c index 3fb97581..cad41388 100644 --- a/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/space_around_struct_member.c +++ b/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/space_around_struct_member.c @@ -1,12 +1,12 @@ struct s { - int a; + int a; }; int main(void) { - // struct member operator (.) can be separate by whitespace from - // both struct and field name - struct s foo; - foo. a=10; - int b = foo .a ; + // struct member operator (.) can be separate by whitespace from + // both struct and field name + struct s foo; + foo .a = 10; + int b = foo .a; - return foo . a == b; + return foo . a == b; } \ No newline at end of file diff --git a/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/struct_member_looks_like_const.c b/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/struct_member_looks_like_const.c index ff2bc702..cc6460fb 100644 --- a/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/struct_member_looks_like_const.c +++ b/tests/chapter_18/valid/no_structure_parameters/parse_and_lex/struct_member_looks_like_const.c @@ -1,8 +1,8 @@ struct s { - int E10; + int E10; }; int main(void) { - struct s x1 = {3}; - return x1.E10; // lex correctly, recognizing that 1.E10 is not a constant + struct s x1 = {3}; + return x1.E10; // lex correctly, recognizing that 1.E10 is not a constant } diff --git a/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/arrow.c b/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/arrow.c index cd2c8a91..b6fc19a4 100644 --- a/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/arrow.c +++ b/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/arrow.c @@ -79,7 +79,8 @@ int test_static(void) { // test reading, writing, and getting address of members // in struct with static storage duration static struct four_members stat; - static struct four_members *stat_ptr = &stat; + static struct four_members *stat_ptr; + stat_ptr = &stat; static char chr = 100; // same test as test_auto above diff --git a/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/linked_list.c b/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/linked_list.c index c6497fc9..6d297be7 100644 --- a/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/linked_list.c +++ b/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/linked_list.c @@ -10,12 +10,14 @@ struct linked_list_node { }; struct linked_list_node *array_to_list(int *array, int count) { - struct linked_list_node *head = (struct linked_list_node *) malloc(sizeof(struct linked_list_node)); + struct linked_list_node *head = + (struct linked_list_node *)malloc(sizeof(struct linked_list_node)); head->val = array[0]; head->next = 0; struct linked_list_node *current = head; for (int i = 1; i < count; i = i + 1) { - current->next = (struct linked_list_node *) malloc(sizeof(struct linked_list_node)); + current->next = + (struct linked_list_node *)malloc(sizeof(struct linked_list_node)); current->next->next = 0; current->next->val = array[i]; current = current->next; @@ -25,14 +27,15 @@ struct linked_list_node *array_to_list(int *array, int count) { int main(void) { int arr[4] = {9, 8, 7, 6}; - struct linked_list_node *elem = array_to_list(arr,4); + struct linked_list_node *elem = array_to_list(arr, 4); for (int i = 0; i < 4; i = i + 1) { int expected = arr[i]; if (elem->val != expected) { - return i + 1; // return 1 if 0th element is wrong, 2 if 1st elem is wrong, etc. + return i + 1; // return 1 if 0th element is wrong, 2 if 1st elem is + // wrong, etc. } elem = elem->next; } - return 0; // success + return 0; // success } \ No newline at end of file diff --git a/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/nested_struct.c b/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/nested_struct.c index a3e6f8c2..76dab6c2 100644 --- a/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/nested_struct.c +++ b/tests/chapter_18/valid/no_structure_parameters/scalar_member_access/nested_struct.c @@ -158,8 +158,9 @@ int test_static_arrow(void) { static struct inner in; static struct outer s; - // shouldn't really matter if this pointer is static, - static struct outer *s_ptr = &s; + // shouldn't really matter if this pointer is static + static struct outer *s_ptr; + s_ptr = &s; s_ptr->in_ptr = ∈ diff --git a/tests/chapter_18/valid/no_structure_parameters/semantic_analysis/cast_struct_to_void.c b/tests/chapter_18/valid/no_structure_parameters/semantic_analysis/cast_struct_to_void.c index 5ca2eebd..39c07799 100644 --- a/tests/chapter_18/valid/no_structure_parameters/semantic_analysis/cast_struct_to_void.c +++ b/tests/chapter_18/valid/no_structure_parameters/semantic_analysis/cast_struct_to_void.c @@ -9,6 +9,6 @@ struct s { int main(void) { struct s x = {1, 2}; - (void) x; // just make sure this doesn't cause a type error + (void)x; // just make sure this doesn't cause a type error return 0; } \ No newline at end of file diff --git a/tests/chapter_18/valid/no_structure_parameters/semantic_analysis/incomplete_structs.c b/tests/chapter_18/valid/no_structure_parameters/semantic_analysis/incomplete_structs.c index 5c3d29a2..a8259438 100644 --- a/tests/chapter_18/valid/no_structure_parameters/semantic_analysis/incomplete_structs.c +++ b/tests/chapter_18/valid/no_structure_parameters/semantic_analysis/incomplete_structs.c @@ -9,36 +9,44 @@ #pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch" #endif #endif + +void *malloc(unsigned long size); +void *calloc(unsigned long nmemb, unsigned long size); int puts(char *s); +int strcmp(char *s1, char *s2); -// test 1: you can declare a function that accepts/returns incomplete struct types -// we don't define or use this function, we just need to validate -// that this declaration doesn't cause a compiler error -// TODO include test in appropriate folder where we define/call this after completing the type +// test 1: you can declare a function that accepts/returns incomplete struct +// types we don't define or use this function, we just need to validate that +// this declaration doesn't cause a compiler error +// TODO include test in appropriate folder where we define/call this after +// completing the type struct never_used; struct never_used incomplete_fun(struct never_used x); // test 2: you can declare an incomplete struct type at block scope, // then complete it int test_block_scope_forward_decl(void) { - struct s; // declare incomplete struct type - struct s *s_ptr = 0; // define a pointer to that struct type + struct s; // declare incomplete struct type + struct s *s_ptr = 0; // define a pointer to that struct type - struct s { int x; int y; }; // complete the type + struct s { + int x; + int y; + }; // complete the type // now you can use s_ptr as a pointer to a completed type - struct s val = { 1, 2 }; + struct s val = {1, 2}; s_ptr = &val; - if (s_ptr->x != 1 || s_ptr ->y != 2) { + if (s_ptr->x != 1 || s_ptr->y != 2) { return 0; } - return 1; // success + return 1; // success } // test 3: you can declare an incomplete struct type at file scope, // then complete it -struct pair; // declare an incomplete type +struct pair; // declare an incomplete type // declare functions involving pointers to that type struct pair *make_struct(void); @@ -59,13 +67,13 @@ struct pair { // define the functions struct pair *make_struct(void) { - struct pair *retval = malloc(sizeof (struct pair)); + struct pair *retval = malloc(sizeof(struct pair)); retval->l = 100; retval->m = 200; return retval; } -int validate_struct (struct pair *ptr) { +int validate_struct(struct pair *ptr) { return (ptr->l == 100 && ptr->m == 200); } @@ -80,7 +88,6 @@ int validate_incomplete_var(void); extern struct msg_holder incomplete_var; int test_incomplete_var(void) { - // okay to take address of incomplete var print_msg(&incomplete_var); return validate_incomplete_var(); @@ -97,18 +104,19 @@ int validate_incomplete_var(void) { return 0; } - return 1; // succes + return 1; // succes } // and we can define it struct msg_holder incomplete_var = {"I'm a struct!"}; // also need to define print_msg -void print_msg(struct msg_holder *param){ +void print_msg(struct msg_holder *param) { puts(param->msg); } -// test 5: you can dereference a pointer to an incomplete var, then take its address +// test 5: you can dereference a pointer to an incomplete var, then take its +// address int test_deref_incomplete_var(void) { struct undefined_struct; struct undefined_struct *ptr = malloc(4); @@ -131,20 +139,19 @@ struct opaque_struct *use_struct_pointers(struct opaque_struct *param) { } int test_use_incomplete_struct_pointers(void) { - // define a couple of pointers to this type struct opaque_struct *ptr1 = calloc(1, 4); struct opaque_struct *ptr2 = calloc(1, 4); // can cast to char * and inspect; this is well-defined // and all bits should be 0 since we used calloc - char *ptr1_bytes = (char *) ptr1; + char *ptr1_bytes = (char *)ptr1; if (ptr1_bytes[0] || ptr1_bytes[1]) { return 0; } // can compare to 0 or each other - if (ptr1 == 0 || ptr2 == 0 || ptr1 == ptr1) { + if (ptr1 == 0 || ptr2 == 0 || ptr1 == ptr2) { return 0; } @@ -159,7 +166,7 @@ int test_use_incomplete_struct_pointers(void) { return 0; } - return 1; // success + return 1; // success } int main(void) { @@ -183,5 +190,5 @@ int main(void) { return 6; } - return 0; // success + return 0; // success } \ No newline at end of file diff --git a/tests/chapter_18/valid/no_structure_parameters/size_and_offset_calculations/sizeof_exps.c b/tests/chapter_18/valid/no_structure_parameters/size_and_offset_calculations/sizeof_exps.c index 112f4aad..39f0e74d 100644 --- a/tests/chapter_18/valid/no_structure_parameters/size_and_offset_calculations/sizeof_exps.c +++ b/tests/chapter_18/valid/no_structure_parameters/size_and_offset_calculations/sizeof_exps.c @@ -1,7 +1,8 @@ /* Verify that sizeof produces correct results for various expressions of * structure type. This is almost identical of sizeof_type except we're applying * sizeof to expressions and not just type specifiers. - * This also tests that we correctly infer the types of expressions w/ structure type + * This also tests that we correctly infer the types of expressions w/ structure + * type * */ #include "struct_sizes.h" @@ -15,7 +16,8 @@ int main(void) { struct contains_struct_array arr_struct; - if (sizeof arr_struct.struct_array[2] != 8) { // elements of struct_array have type struct eight_bytes + if (sizeof arr_struct.struct_array[2] != + 8) { // elements of struct_array have type struct eight_bytes return 1; } @@ -66,5 +68,5 @@ int main(void) { return 12; } - return 0; // success + return 0; // success } \ No newline at end of file diff --git a/tests/chapter_18/valid/no_structure_parameters/smoke_tests/simple.c b/tests/chapter_18/valid/no_structure_parameters/smoke_tests/simple.c index 3257a35d..871e827f 100644 --- a/tests/chapter_18/valid/no_structure_parameters/smoke_tests/simple.c +++ b/tests/chapter_18/valid/no_structure_parameters/smoke_tests/simple.c @@ -1,4 +1,5 @@ -/* basic test of struct type declarations, compound initializers, and member access */ +/* basic test of struct type declarations, compound initializers, and member + * access */ // declare a structure type struct pair { diff --git a/tests/chapter_18/valid/no_structure_parameters/smoke_tests/static_vs_auto.c b/tests/chapter_18/valid/no_structure_parameters/smoke_tests/static_vs_auto.c index ea3fa365..72079176 100644 --- a/tests/chapter_18/valid/no_structure_parameters/smoke_tests/static_vs_auto.c +++ b/tests/chapter_18/valid/no_structure_parameters/smoke_tests/static_vs_auto.c @@ -1,5 +1,6 @@ -// make sure structs w/ automatic storage duration are reinitialized whenver they come into scope -// and structs w/ static storage duration are initialized only once +// make sure structs w/ automatic storage duration are reinitialized whenver +// they come into scope and structs w/ static storage duration are initialized +// only once struct s { int a; @@ -17,19 +18,20 @@ int main(void) { stat.a = stat.a + 1; stat.b = stat.b + 1; - // on last iteration, validate both structs if (i == 9) { - // stat should be {10, 11} b/c both members were incremented on each iteration + // stat should be {10, 11} b/c both members were incremented on each + // iteration if (stat.a != 11 || stat.b != 12) { return 1; } - // autom should be {2, 3} b/c it was reinitialized on every iteration + // autom should be {2, 3} b/c it was reinitialized on every + // iteration if (autom.a != 2 || autom.b != 3) { return 2; } } } - return 0; // success + return 0; // success } \ No newline at end of file diff --git a/tests/chapter_18/valid/no_structure_parameters/struct_copy/copy_struct.c b/tests/chapter_18/valid/no_structure_parameters/struct_copy/copy_struct.c index b45b6eac..226ef664 100644 --- a/tests/chapter_18/valid/no_structure_parameters/struct_copy/copy_struct.c +++ b/tests/chapter_18/valid/no_structure_parameters/struct_copy/copy_struct.c @@ -5,6 +5,10 @@ #include "structs.h" +#ifdef SUPPRESS_WARNINGS +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif + // test 1: copy one struct with auto storage duration to another int test_auto(void) { struct s x = {"ab", {-1, 2}}; @@ -25,10 +29,10 @@ int test_auto(void) { // test 2: copy one struct with static storage duration to another int test_static(void) { - static struct s x = {"ab", {-1, 2}}; + static struct s x = {"ab", {1, 2}}; static struct s y; y = x; - if (strcmp(y.arr, "ab") || y.inner.a != -1 || y.inner.b != 2) { + if (strcmp(y.arr, "ab") || y.inner.a != 1 || y.inner.b != 2) { return 0; } @@ -59,7 +63,6 @@ int test_conditional(void) { static struct s x = {"xy", {1234, 5678}}; struct s y = {"!", {-10}}; struct s z; - static int tru = 1; z = true_flag() ? x : y; if (strcmp(z.arr, "xy") || z.inner.a != 1234 || z.inner.b != 5678) { return 0; diff --git a/tests/chapter_18/valid/no_structure_parameters/struct_copy/copy_struct_with_arrow_operator.c b/tests/chapter_18/valid/no_structure_parameters/struct_copy/copy_struct_with_arrow_operator.c index 1cd8e1b3..068888c9 100644 --- a/tests/chapter_18/valid/no_structure_parameters/struct_copy/copy_struct_with_arrow_operator.c +++ b/tests/chapter_18/valid/no_structure_parameters/struct_copy/copy_struct_with_arrow_operator.c @@ -153,15 +153,16 @@ int test_mixed_nested_access(void) { int test_member_from_cast(void) { struct inner small = {20.0, 10}; - void *outer_ptr = calloc(1, sizeof (struct outer)); + void *outer_ptr = calloc(1, sizeof(struct outer)); ((struct outer *)outer_ptr)->substruct = small; // validate - if (((struct outer *)outer_ptr)->substruct.d != 20.0 || ((struct outer *)outer_ptr)->substruct.i != 10) { + if (((struct outer *)outer_ptr)->substruct.d != 20.0 || + ((struct outer *)outer_ptr)->substruct.i != 10) { return 0; } - return 1; // success + return 1; // success } int main(void) { diff --git a/tests/chapter_18/valid/parameters/incomplete_param_type.c b/tests/chapter_18/valid/parameters/incomplete_param_type.c index 27785cd6..672ff4a0 100644 --- a/tests/chapter_18/valid/parameters/incomplete_param_type.c +++ b/tests/chapter_18/valid/parameters/incomplete_param_type.c @@ -8,7 +8,7 @@ struct s { }; int main(void) { - struct s arg = { 1, 2}; + struct s arg = {1, 2}; return foo(arg); } diff --git a/tests/chapter_18/valid/parameters/libraries/array_of_structs.c b/tests/chapter_18/valid/parameters/libraries/array_of_structs.c index d6f9eed5..8d89fc10 100644 --- a/tests/chapter_18/valid/parameters/libraries/array_of_structs.c +++ b/tests/chapter_18/valid/parameters/libraries/array_of_structs.c @@ -1,15 +1,15 @@ #include "array_of_structs.h" int validate_struct_array(struct outer *struct_array) { - for (int i = 0; i < 3; i = i + 1) { - if (struct_array[i].a != i * 2) - return i; - if (struct_array[i].b.l != i * 3) - return i * 10; - if (struct_array[i].b.arr[0] != i * 4) - return i * 25; - if (struct_array[i].b.arr[1] != i * 5) - return i * 11; - } - return 0; + for (int i = 0; i < 3; i = i + 1) { + if (struct_array[i].a != i * 2) + return i; + if (struct_array[i].b.l != i * 3) + return i * 10; + if (struct_array[i].b.arr[0] != i * 4) + return i * 25; + if (struct_array[i].b.arr[1] != i * 5) + return i * 11; + } + return 0; } \ No newline at end of file diff --git a/tests/chapter_18/valid/parameters/libraries/array_of_structs.h b/tests/chapter_18/valid/parameters/libraries/array_of_structs.h index 2326ff52..fb20b6ef 100644 --- a/tests/chapter_18/valid/parameters/libraries/array_of_structs.h +++ b/tests/chapter_18/valid/parameters/libraries/array_of_structs.h @@ -1,12 +1,12 @@ struct inner { - long l; - char arr[2]; -}; // size: 8 bytes, alignment: 4 bytes + long l; + char arr[2]; +}; // size: 8 bytes, alignment: 4 bytes struct outer { - char a; // byte 0 - struct inner b; // bytes 4-11 + char a; // byte 0 + struct inner b; // bytes 4-11 -}; // size: 12 byte, alignment: 4 bytes +}; // size: 12 byte, alignment: 4 bytes int validate_struct_array(struct outer *struct_array); \ No newline at end of file diff --git a/tests/chapter_18/valid/parameters/libraries/array_of_structs_client.c b/tests/chapter_18/valid/parameters/libraries/array_of_structs_client.c index c918d38f..bb71a27f 100644 --- a/tests/chapter_18/valid/parameters/libraries/array_of_structs_client.c +++ b/tests/chapter_18/valid/parameters/libraries/array_of_structs_client.c @@ -4,11 +4,11 @@ static struct outer static_array[3] = { {0, {0, {0, 0}}}, {2, {3, {4, 5}}}, {4, {6, {8, 10}}}}; int main(void) { - struct outer auto_array[3] = { - {0, {0, {0, 0}}}, {2, {3, {4, 5}}}, {4, {6, {8, 10}}}}; + struct outer auto_array[3] = { + {0, {0, {0, 0}}}, {2, {3, {4, 5}}}, {4, {6, {8, 10}}}}; - int static_result = validate_struct_array(static_array); - if (static_result) - return static_result + 3; - return validate_struct_array(auto_array); + int static_result = validate_struct_array(static_array); + if (static_result) + return static_result + 3; + return validate_struct_array(auto_array); } \ No newline at end of file diff --git a/tests/chapter_18/valid/parameters/libraries/param_calling_conventions.c b/tests/chapter_18/valid/parameters/libraries/param_calling_conventions.c index 8d44e448..94a05212 100644 --- a/tests/chapter_18/valid/parameters/libraries/param_calling_conventions.c +++ b/tests/chapter_18/valid/parameters/libraries/param_calling_conventions.c @@ -5,116 +5,120 @@ int pass_small_structs(struct two_xmm two_xmm_struct, struct one_int int_struct, struct xmm_and_int mixed_struct, struct twelve_bytes int_struct_2, struct one_int_exactly another_int_struct) { - if (two_xmm_struct.d[0] != 55.5 || two_xmm_struct.d[1] != 44.4) - return 1; + if (two_xmm_struct.d[0] != 55.5 || two_xmm_struct.d[1] != 44.4) + return 1; - if (int_struct.c != 'c' || int_struct.i != 54320) - return 2; - if (xmm_struct.d != 5.125) - return 3; - if (strcmp(mixed_struct.c, "hi") || mixed_struct.dbl.d != 1.234) - return 4; - if (strcmp(int_struct_2.arr, "string!") || int_struct_2.i != 123) - return 5; + if (int_struct.c != 'c' || int_struct.i != 54320) + return 2; + if (xmm_struct.d != 5.125) + return 3; + if (strcmp(mixed_struct.c, "hi") || mixed_struct.dbl.d != 1.234) + return 4; + if (strcmp(int_struct_2.arr, "string!") || int_struct_2.i != 123) + return 5; - if (another_int_struct.l != 567890) - return 6; + if (another_int_struct.l != 567890) + return 6; - return 0; + return 0; } int structs_and_scalars(long l, double d, struct odd_size os, struct memory mem, struct one_xmm xmm_struct) { - if (l != 10) - return 7; - if (d != 10.0) - return 8; - if (strcmp(os.arr, "lmno")) - return 9; - if (strcmp(mem.c, "rs") || mem.d != 15.75 || mem.i != 3333 || mem.l != 4444) - return 10; - if (xmm_struct.d != 5.125) - return 11; + if (l != 10) + return 7; + if (d != 10.0) + return 8; + if (strcmp(os.arr, "lmno")) + return 9; + if (strcmp(mem.c, "rs") || mem.d != 15.75 || mem.i != 3333 || mem.l != 4444) + return 10; + if (xmm_struct.d != 5.125) + return 11; - return 0; + return 0; } int struct_in_mem(double a, double b, double c, struct xmm_and_int first_struct, double d, struct two_xmm second_struct, long l, struct int_and_xmm third_struct, struct one_xmm fourth_struct) { - if (a != 10.0 || b != 11.125 || c != 12.0) - return 12; - if (strcmp(first_struct.c, "hi") || first_struct.dbl.d != 1.234) - return 13; - if (d != 13.0) - return 14; - if (second_struct.d[0] != 55.5 || second_struct.d[1] != 44.4) - return 15; - if (l) - return 16; - if (third_struct.c != 'p' || third_struct.d != 4.56) - return 17; - if (fourth_struct.d != 5.125) - return 18; + if (a != 10.0 || b != 11.125 || c != 12.0) + return 12; + if (strcmp(first_struct.c, "hi") || first_struct.dbl.d != 1.234) + return 13; + if (d != 13.0) + return 14; + if (second_struct.d[0] != 55.5 || second_struct.d[1] != 44.4) + return 15; + if (l) + return 16; + if (third_struct.c != 'p' || third_struct.d != 4.56) + return 17; + if (fourth_struct.d != 5.125) + return 18; - return 0; + return 0; } int pass_borderline_struct_in_memory(struct two_ints t_i, char c, struct int_and_xmm i_x, void *ptr, struct two_ints_nested t_i_n, double d) { - if (t_i.c != '_' || t_i.arr[0] != 5 || t_i.arr[1] != 6 || t_i.arr[2] != 7) - return 19; - if (c != '!') - return 20; - if (i_x.c != 'p' || i_x.d != 4.56) - return 21; + if (t_i.c != '_' || t_i.arr[0] != 5 || t_i.arr[1] != 6 || t_i.arr[2] != 7) + return 19; + if (c != '!') + return 20; + if (i_x.c != 'p' || i_x.d != 4.56) + return 21; - if (ptr) - return 22; + if (ptr) + return 22; - if (t_i_n.a.c != 'c' || t_i_n.a.i != 54320) - return 23; - if (t_i_n.b.c != 'c' || t_i_n.b.i != 54320) - return 24; - if (d != 7.8) - return 25; - return 0; + if (t_i_n.a.c != 'c' || t_i_n.a.i != 54320) + return 23; + if (t_i_n.b.c != 'c' || t_i_n.b.i != 54320) + return 24; + if (d != 7.8) + return 25; + return 0; } -int pass_uneven_struct_in_mem(struct twelve_bytes struct1, long a, long b, struct twelve_bytes struct2, struct odd_size os, struct memory m) { - if (struct1.i != -1) { - return 26; - } - if (struct1.arr[0] != 127 || struct1.arr[1] != 126|| struct1.arr[2] != 125) { - return 27; - } - if (a != 9223372036854775805l || b != 9223372036854775800l) { - return 28; - } - if (struct2.i != -5) { - return 29; - } - if (struct2.arr[0] != 100 || struct2.arr[1] != 101|| struct2.arr[2] != 102) { - return 30; - } - for (int i = 0; i < 5; i = i + 1) { - if (os.arr[i] != 100-i) { - return 31; +int pass_uneven_struct_in_mem(struct twelve_bytes struct1, long a, long b, + struct twelve_bytes struct2, struct odd_size os, + struct memory m) { + if (struct1.i != -1) { + return 26; } - } - if (m.d != 5.345) { - return 32; - } - if (m.c[0] != -1 || m.c[1] != -2 || m.c[2] != -3) { - return 33; - } - if (m.l != 4294967300l) { - return 34; - } - if (m.i != 10000) { - return 35; - } - return 0; + if (struct1.arr[0] != 127 || struct1.arr[1] != 126 || + struct1.arr[2] != 125) { + return 27; + } + if (a != 9223372036854775805l || b != 9223372036854775800l) { + return 28; + } + if (struct2.i != -5) { + return 29; + } + if (struct2.arr[0] != 100 || struct2.arr[1] != 101 || + struct2.arr[2] != 102) { + return 30; + } + for (int i = 0; i < 5; i = i + 1) { + if (os.arr[i] != 100 - i) { + return 31; + } + } + if (m.d != 5.345) { + return 32; + } + if (m.c[0] != -1 || m.c[1] != -2 || m.c[2] != -3) { + return 33; + } + if (m.l != 4294967300l) { + return 34; + } + if (m.i != 10000) { + return 35; + } + return 0; } \ No newline at end of file diff --git a/tests/chapter_18/valid/parameters/libraries/param_calling_conventions.h b/tests/chapter_18/valid/parameters/libraries/param_calling_conventions.h index 2d54d15c..3e16795f 100644 --- a/tests/chapter_18/valid/parameters/libraries/param_calling_conventions.h +++ b/tests/chapter_18/valid/parameters/libraries/param_calling_conventions.h @@ -86,4 +86,6 @@ int pass_borderline_struct_in_memory(struct two_ints t_i, char c, struct two_ints_nested t_i_n, double d); // pass a struct in memory that isn't neatly divisible by 8 -int pass_uneven_struct_in_mem(struct twelve_bytes struct1, long a, long b, struct twelve_bytes struct2, struct odd_size os, struct memory m); \ No newline at end of file +int pass_uneven_struct_in_mem(struct twelve_bytes struct1, long a, long b, + struct twelve_bytes struct2, struct odd_size os, + struct memory m); \ No newline at end of file diff --git a/tests/chapter_18/valid/parameters/libraries/param_calling_conventions_client.c b/tests/chapter_18/valid/parameters/libraries/param_calling_conventions_client.c index 1e96c39f..de42f670 100644 --- a/tests/chapter_18/valid/parameters/libraries/param_calling_conventions_client.c +++ b/tests/chapter_18/valid/parameters/libraries/param_calling_conventions_client.c @@ -1,55 +1,55 @@ #include "param_calling_conventions.h" int main(void) { - struct one_int one_int = {54320, 'c'}; - struct one_int_exactly one_long = {567890l}; - struct two_ints two_ints = {'_', {5, 6, 7}}; - struct two_ints_nested two_ints_nested = {one_int, one_int}; - struct twelve_bytes xii = {123, "string!"}; - - struct one_xmm one_xmm = {5.125}; - struct two_xmm two_xmm = {{55.5, 44.4}}; - struct int_and_xmm int_and_xmm = {'p', 4.56}; - struct xmm_and_int xmm_and_int = {{1.234}, "hi"}; - - struct odd_size odd = {"lmno"}; - struct memory mem = {15.75, "rs", 4444, 3333}; - - int retval; - - // test parameter passing - - retval = - pass_small_structs(two_xmm, one_int, one_xmm, xmm_and_int, xii, one_long); - if (retval) { - return retval; - } - - retval = structs_and_scalars(10, 10.0, odd, mem, one_xmm); - if (retval) { - return retval; - } - - retval = struct_in_mem(10.0, 11.125, 12.0, xmm_and_int, 13.0, two_xmm, 0, - int_and_xmm, one_xmm); - if (retval) - return retval; - - retval = pass_borderline_struct_in_memory(two_ints, '!', int_and_xmm, 0, - two_ints_nested, 7.8); - if (retval) - return retval; - - - struct twelve_bytes struct1 = {-1, {127, 126, 125}}; - struct twelve_bytes struct2 = {-5, {100, 101, 102}}; - struct odd_size os = {{100, 99, 98, 97, 96}}; - struct memory m = {5.345, {-1, -2, -3}, 4294967300l, 10000}; - retval = pass_uneven_struct_in_mem(struct1, 9223372036854775805l, 9223372036854775800l, struct2, os, m); - - if (retval) - return retval; - - // success! - return 0; + struct one_int one_int = {54320, 'c'}; + struct one_int_exactly one_long = {567890l}; + struct two_ints two_ints = {'_', {5, 6, 7}}; + struct two_ints_nested two_ints_nested = {one_int, one_int}; + struct twelve_bytes xii = {123, "string!"}; + + struct one_xmm one_xmm = {5.125}; + struct two_xmm two_xmm = {{55.5, 44.4}}; + struct int_and_xmm int_and_xmm = {'p', 4.56}; + struct xmm_and_int xmm_and_int = {{1.234}, "hi"}; + + struct odd_size odd = {"lmno"}; + struct memory mem = {15.75, "rs", 4444, 3333}; + + int retval; + + // test parameter passing + + retval = pass_small_structs(two_xmm, one_int, one_xmm, xmm_and_int, xii, + one_long); + if (retval) { + return retval; + } + + retval = structs_and_scalars(10, 10.0, odd, mem, one_xmm); + if (retval) { + return retval; + } + + retval = struct_in_mem(10.0, 11.125, 12.0, xmm_and_int, 13.0, two_xmm, 0, + int_and_xmm, one_xmm); + if (retval) + return retval; + + retval = pass_borderline_struct_in_memory(two_ints, '!', int_and_xmm, 0, + two_ints_nested, 7.8); + if (retval) + return retval; + + struct twelve_bytes struct1 = {-1, {127, 126, 125}}; + struct twelve_bytes struct2 = {-5, {100, 101, 102}}; + struct odd_size os = {{100, 99, 98, 97, 96}}; + struct memory m = {5.345, {-1, -2, -3}, 4294967300l, 10000}; + retval = pass_uneven_struct_in_mem(struct1, 9223372036854775805l, + 9223372036854775800l, struct2, os, m); + + if (retval) + return retval; + + // success! + return 0; } \ No newline at end of file diff --git a/tests/chapter_18/valid/parameters/libraries/pass_struct_client.c b/tests/chapter_18/valid/parameters/libraries/pass_struct_client.c index 93e2c0c8..0520e8f0 100644 --- a/tests/chapter_18/valid/parameters/libraries/pass_struct_client.c +++ b/tests/chapter_18/valid/parameters/libraries/pass_struct_client.c @@ -6,6 +6,6 @@ struct pair { int foo(struct pair p); int main(void) { - struct pair arg = { 1, 2}; + struct pair arg = {1, 2}; return foo(arg); } \ No newline at end of file diff --git a/tests/chapter_18/valid/parameters/libraries/preserve_stack.c b/tests/chapter_18/valid/parameters/libraries/preserve_stack.c index 802bb398..f45d196b 100644 --- a/tests/chapter_18/valid/parameters/libraries/preserve_stack.c +++ b/tests/chapter_18/valid/parameters/libraries/preserve_stack.c @@ -12,7 +12,8 @@ int check_struct(void) { if (internal.arr[0] || internal.arr[1] || internal.arr[2]) { return 1; } - if (internal.arr[3] != 1 || internal.arr[4] != 2 || internal.arr[5] != 3 || internal.arr[6] !=4) { + if (internal.arr[3] != 1 || internal.arr[4] != 2 || internal.arr[5] != 3 || + internal.arr[6] != 4) { return 1; } return 0; diff --git a/tests/chapter_18/valid/parameters/libraries/preserve_stack_client.c b/tests/chapter_18/valid/parameters/libraries/preserve_stack_client.c index 12d3b625..a2e6d3e8 100644 --- a/tests/chapter_18/valid/parameters/libraries/preserve_stack_client.c +++ b/tests/chapter_18/valid/parameters/libraries/preserve_stack_client.c @@ -1,5 +1,6 @@ -// Make sure that when we copy values into the red zone during arg passing, we don't accidentally clobber the actual stack; -// this is a regression test for a bug in found in NQCC - copied into 0(rsp) instead of -8(rsp) +// Make sure that when we copy values into the red zone during arg passing, we +// don't accidentally clobber the actual stack; this is a regression test for a +// bug in found in NQCC - copied into 0(rsp) instead of -8(rsp) struct my_struct { char arr[7]; @@ -10,13 +11,14 @@ long glob = 0; struct my_struct s = {{0, 0, 0, 1, 2, 3, 4}}; void process_struct(struct my_struct arg); -int check_struct(void); // return 0 if static struct in lib is as expected, 1 otherwise +int check_struct( + void); // return 0 if static struct in lib is as expected, 1 otherwise long f(void) { // can we find a less fragile test for this? assembly again? - long x = glob - 2l; // x should be at 0(%rsp) - process_struct(s); // we copy s into red zone and then into RDI - return x; // return X, make sure it wasn't overwritten + long x = glob - 2l; // x should be at 0(%rsp) + process_struct(s); // we copy s into red zone and then into RDI + return x; // return X, make sure it wasn't overwritten } int main(void) { diff --git a/tests/chapter_18/valid/parameters/libraries/struct_sizes.c b/tests/chapter_18/valid/parameters/libraries/struct_sizes.c index 877ac870..64c4007e 100644 --- a/tests/chapter_18/valid/parameters/libraries/struct_sizes.c +++ b/tests/chapter_18/valid/parameters/libraries/struct_sizes.c @@ -2,8 +2,26 @@ #include "struct_sizes.h" int memcmp(void *s1, void *s2, unsigned long n); -int fun0 (struct bytesize1 a, struct bytesize2 b, struct bytesize3 c, struct bytesize4 d, struct bytesize5 e, struct bytesize6 f, struct bytesize7 g, struct bytesize8 h, struct bytesize9 i, struct bytesize10 j, struct bytesize11 k, struct bytesize12 l, struct bytesize13 m, struct bytesize14 n, struct bytesize15 o, struct bytesize16 p, struct bytesize17 q, struct bytesize18 r, struct bytesize19 s, struct bytesize20 t, struct bytesize21 u, struct bytesize22 v, struct bytesize23 w, struct bytesize24 x, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected, unsigned char *d_expected, unsigned char *e_expected, unsigned char *f_expected, unsigned char *g_expected, unsigned char *h_expected, unsigned char *i_expected, unsigned char *j_expected, unsigned char *k_expected, unsigned char *l_expected, unsigned char *m_expected, unsigned char *n_expected, unsigned char *o_expected, unsigned char *p_expected, unsigned char *q_expected, unsigned char *r_expected, unsigned char *s_expected, unsigned char *t_expected, unsigned char *u_expected, unsigned char *v_expected, unsigned char *w_expected, unsigned char *x_expected) { - +int fun0(struct bytesize1 a, struct bytesize2 b, struct bytesize3 c, + struct bytesize4 d, struct bytesize5 e, struct bytesize6 f, + struct bytesize7 g, struct bytesize8 h, struct bytesize9 i, + struct bytesize10 j, struct bytesize11 k, struct bytesize12 l, + struct bytesize13 m, struct bytesize14 n, struct bytesize15 o, + struct bytesize16 p, struct bytesize17 q, struct bytesize18 r, + struct bytesize19 s, struct bytesize20 t, struct bytesize21 u, + struct bytesize22 v, struct bytesize23 w, struct bytesize24 x, + unsigned char *a_expected, unsigned char *b_expected, + unsigned char *c_expected, unsigned char *d_expected, + unsigned char *e_expected, unsigned char *f_expected, + unsigned char *g_expected, unsigned char *h_expected, + unsigned char *i_expected, unsigned char *j_expected, + unsigned char *k_expected, unsigned char *l_expected, + unsigned char *m_expected, unsigned char *n_expected, + unsigned char *o_expected, unsigned char *p_expected, + unsigned char *q_expected, unsigned char *r_expected, + unsigned char *s_expected, unsigned char *t_expected, + unsigned char *u_expected, unsigned char *v_expected, + unsigned char *w_expected, unsigned char *x_expected) { if (memcmp(&a, a_expected, sizeof a)) { return 1; } @@ -102,8 +120,15 @@ int fun0 (struct bytesize1 a, struct bytesize2 b, struct bytesize3 c, struct byt return 0; } -int fun1 (struct bytesize7 a, struct bytesize8 b, struct bytesize9 c, struct bytesize10 d, struct bytesize1 e, struct bytesize2 f, struct bytesize3 g, struct bytesize4 h, struct bytesize5 i, struct bytesize6 j, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected, unsigned char *d_expected, unsigned char *e_expected, unsigned char *f_expected, unsigned char *g_expected, unsigned char *h_expected, unsigned char *i_expected, unsigned char *j_expected) { - +int fun1(struct bytesize7 a, struct bytesize8 b, struct bytesize9 c, + struct bytesize10 d, struct bytesize1 e, struct bytesize2 f, + struct bytesize3 g, struct bytesize4 h, struct bytesize5 i, + struct bytesize6 j, unsigned char *a_expected, + unsigned char *b_expected, unsigned char *c_expected, + unsigned char *d_expected, unsigned char *e_expected, + unsigned char *f_expected, unsigned char *g_expected, + unsigned char *h_expected, unsigned char *i_expected, + unsigned char *j_expected) { if (memcmp(&a, a_expected, sizeof a)) { return 1; } @@ -146,8 +171,10 @@ int fun1 (struct bytesize7 a, struct bytesize8 b, struct bytesize9 c, struct byt return 0; } -int fun2 (struct bytesize11 a, struct bytesize12 b, struct bytesize13 c, struct bytesize1 d, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected, unsigned char *d_expected) { - +int fun2(struct bytesize11 a, struct bytesize12 b, struct bytesize13 c, + struct bytesize1 d, unsigned char *a_expected, + unsigned char *b_expected, unsigned char *c_expected, + unsigned char *d_expected) { if (memcmp(&a, a_expected, sizeof a)) { return 1; } @@ -166,8 +193,10 @@ int fun2 (struct bytesize11 a, struct bytesize12 b, struct bytesize13 c, struct return 0; } -int fun3 (struct bytesize14 a, struct bytesize15 b, struct bytesize16 c, struct bytesize2 d, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected, unsigned char *d_expected) { - +int fun3(struct bytesize14 a, struct bytesize15 b, struct bytesize16 c, + struct bytesize2 d, unsigned char *a_expected, + unsigned char *b_expected, unsigned char *c_expected, + unsigned char *d_expected) { if (memcmp(&a, a_expected, sizeof a)) { return 1; } @@ -186,8 +215,9 @@ int fun3 (struct bytesize14 a, struct bytesize15 b, struct bytesize16 c, struct return 0; } -int fun4 (struct bytesize17 a, struct bytesize18 b, struct bytesize3 c, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected) { - +int fun4(struct bytesize17 a, struct bytesize18 b, struct bytesize3 c, + unsigned char *a_expected, unsigned char *b_expected, + unsigned char *c_expected) { if (memcmp(&a, a_expected, sizeof a)) { return 1; } @@ -202,8 +232,9 @@ int fun4 (struct bytesize17 a, struct bytesize18 b, struct bytesize3 c, unsigned return 0; } -int fun5 (struct bytesize19 a, struct bytesize20 b, struct bytesize4 c, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected) { - +int fun5(struct bytesize19 a, struct bytesize20 b, struct bytesize4 c, + unsigned char *a_expected, unsigned char *b_expected, + unsigned char *c_expected) { if (memcmp(&a, a_expected, sizeof a)) { return 1; } @@ -218,8 +249,9 @@ int fun5 (struct bytesize19 a, struct bytesize20 b, struct bytesize4 c, unsigned return 0; } -int fun6 (struct bytesize21 a, struct bytesize22 b, struct bytesize5 c, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected) { - +int fun6(struct bytesize21 a, struct bytesize22 b, struct bytesize5 c, + unsigned char *a_expected, unsigned char *b_expected, + unsigned char *c_expected) { if (memcmp(&a, a_expected, sizeof a)) { return 1; } @@ -234,8 +266,9 @@ int fun6 (struct bytesize21 a, struct bytesize22 b, struct bytesize5 c, unsigned return 0; } -int fun7 (struct bytesize23 a, struct bytesize24 b, struct bytesize4 c, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected) { - +int fun7(struct bytesize23 a, struct bytesize24 b, struct bytesize4 c, + unsigned char *a_expected, unsigned char *b_expected, + unsigned char *c_expected) { if (memcmp(&a, a_expected, sizeof a)) { return 1; } diff --git a/tests/chapter_18/valid/parameters/libraries/struct_sizes.h b/tests/chapter_18/valid/parameters/libraries/struct_sizes.h index af3c3081..60e4c5e6 100644 --- a/tests/chapter_18/valid/parameters/libraries/struct_sizes.h +++ b/tests/chapter_18/valid/parameters/libraries/struct_sizes.h @@ -149,11 +149,52 @@ struct bytesize24 { }; extern struct bytesize24 globvar_24; -int fun0 (struct bytesize1 a, struct bytesize2 b, struct bytesize3 c, struct bytesize4 d, struct bytesize5 e, struct bytesize6 f, struct bytesize7 g, struct bytesize8 h, struct bytesize9 i, struct bytesize10 j, struct bytesize11 k, struct bytesize12 l, struct bytesize13 m, struct bytesize14 n, struct bytesize15 o, struct bytesize16 p, struct bytesize17 q, struct bytesize18 r, struct bytesize19 s, struct bytesize20 t, struct bytesize21 u, struct bytesize22 v, struct bytesize23 w, struct bytesize24 x, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected, unsigned char *d_expected, unsigned char *e_expected, unsigned char *f_expected, unsigned char *g_expected, unsigned char *h_expected, unsigned char *i_expected, unsigned char *j_expected, unsigned char *k_expected, unsigned char *l_expected, unsigned char *m_expected, unsigned char *n_expected, unsigned char *o_expected, unsigned char *p_expected, unsigned char *q_expected, unsigned char *r_expected, unsigned char *s_expected, unsigned char *t_expected, unsigned char *u_expected, unsigned char *v_expected, unsigned char *w_expected, unsigned char *x_expected); -int fun1 (struct bytesize7 a, struct bytesize8 b, struct bytesize9 c, struct bytesize10 d, struct bytesize1 e, struct bytesize2 f, struct bytesize3 g, struct bytesize4 h, struct bytesize5 i, struct bytesize6 j, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected, unsigned char *d_expected, unsigned char *e_expected, unsigned char *f_expected, unsigned char *g_expected, unsigned char *h_expected, unsigned char *i_expected, unsigned char *j_expected); -int fun2 (struct bytesize11 a, struct bytesize12 b, struct bytesize13 c, struct bytesize1 d, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected, unsigned char *d_expected); -int fun3 (struct bytesize14 a, struct bytesize15 b, struct bytesize16 c, struct bytesize2 d, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected, unsigned char *d_expected); -int fun4 (struct bytesize17 a, struct bytesize18 b, struct bytesize3 c, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected); -int fun5 (struct bytesize19 a, struct bytesize20 b, struct bytesize4 c, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected); -int fun6 (struct bytesize21 a, struct bytesize22 b, struct bytesize5 c, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected); -int fun7 (struct bytesize23 a, struct bytesize24 b, struct bytesize4 c, unsigned char *a_expected, unsigned char *b_expected, unsigned char *c_expected); +int fun0(struct bytesize1 a, struct bytesize2 b, struct bytesize3 c, + struct bytesize4 d, struct bytesize5 e, struct bytesize6 f, + struct bytesize7 g, struct bytesize8 h, struct bytesize9 i, + struct bytesize10 j, struct bytesize11 k, struct bytesize12 l, + struct bytesize13 m, struct bytesize14 n, struct bytesize15 o, + struct bytesize16 p, struct bytesize17 q, struct bytesize18 r, + struct bytesize19 s, struct bytesize20 t, struct bytesize21 u, + struct bytesize22 v, struct bytesize23 w, struct bytesize24 x, + unsigned char *a_expected, unsigned char *b_expected, + unsigned char *c_expected, unsigned char *d_expected, + unsigned char *e_expected, unsigned char *f_expected, + unsigned char *g_expected, unsigned char *h_expected, + unsigned char *i_expected, unsigned char *j_expected, + unsigned char *k_expected, unsigned char *l_expected, + unsigned char *m_expected, unsigned char *n_expected, + unsigned char *o_expected, unsigned char *p_expected, + unsigned char *q_expected, unsigned char *r_expected, + unsigned char *s_expected, unsigned char *t_expected, + unsigned char *u_expected, unsigned char *v_expected, + unsigned char *w_expected, unsigned char *x_expected); +int fun1(struct bytesize7 a, struct bytesize8 b, struct bytesize9 c, + struct bytesize10 d, struct bytesize1 e, struct bytesize2 f, + struct bytesize3 g, struct bytesize4 h, struct bytesize5 i, + struct bytesize6 j, unsigned char *a_expected, + unsigned char *b_expected, unsigned char *c_expected, + unsigned char *d_expected, unsigned char *e_expected, + unsigned char *f_expected, unsigned char *g_expected, + unsigned char *h_expected, unsigned char *i_expected, + unsigned char *j_expected); +int fun2(struct bytesize11 a, struct bytesize12 b, struct bytesize13 c, + struct bytesize1 d, unsigned char *a_expected, + unsigned char *b_expected, unsigned char *c_expected, + unsigned char *d_expected); +int fun3(struct bytesize14 a, struct bytesize15 b, struct bytesize16 c, + struct bytesize2 d, unsigned char *a_expected, + unsigned char *b_expected, unsigned char *c_expected, + unsigned char *d_expected); +int fun4(struct bytesize17 a, struct bytesize18 b, struct bytesize3 c, + unsigned char *a_expected, unsigned char *b_expected, + unsigned char *c_expected); +int fun5(struct bytesize19 a, struct bytesize20 b, struct bytesize4 c, + unsigned char *a_expected, unsigned char *b_expected, + unsigned char *c_expected); +int fun6(struct bytesize21 a, struct bytesize22 b, struct bytesize5 c, + unsigned char *a_expected, unsigned char *b_expected, + unsigned char *c_expected); +int fun7(struct bytesize23 a, struct bytesize24 b, struct bytesize4 c, + unsigned char *a_expected, unsigned char *b_expected, + unsigned char *c_expected); diff --git a/tests/chapter_18/valid/parameters/libraries/struct_sizes_client.c b/tests/chapter_18/valid/parameters/libraries/struct_sizes_client.c index 4e8d592e..bd4cc714 100644 --- a/tests/chapter_18/valid/parameters/libraries/struct_sizes_client.c +++ b/tests/chapter_18/valid/parameters/libraries/struct_sizes_client.c @@ -2,166 +2,243 @@ #include "struct_sizes.h" int main(void) { - - if (fun0(globvar_1, globvar_2, globvar_3, globvar_4, globvar_5, globvar_6, globvar_7, globvar_8, globvar_9, globvar_10, globvar_11, globvar_12, globvar_13, globvar_14, globvar_15, globvar_16, globvar_17, globvar_18, globvar_19, globvar_20, globvar_21, globvar_22, globvar_23, globvar_24, globvar_1.arr, globvar_2.arr, globvar_3.arr, globvar_4.arr, globvar_5.arr, globvar_6.arr, globvar_7.arr, globvar_8.arr, globvar_9.arr, globvar_10.arr, globvar_11.arr, globvar_12.arr, globvar_13.arr, globvar_14.arr, globvar_15.arr, globvar_16.arr, globvar_17.arr, globvar_18.arr, globvar_19.arr, globvar_20.arr, globvar_21.arr, globvar_22.arr, globvar_23.arr, globvar_24.arr)) { + if (fun0(globvar_1, globvar_2, globvar_3, globvar_4, globvar_5, globvar_6, + globvar_7, globvar_8, globvar_9, globvar_10, globvar_11, + globvar_12, globvar_13, globvar_14, globvar_15, globvar_16, + globvar_17, globvar_18, globvar_19, globvar_20, globvar_21, + globvar_22, globvar_23, globvar_24, globvar_1.arr, globvar_2.arr, + globvar_3.arr, globvar_4.arr, globvar_5.arr, globvar_6.arr, + globvar_7.arr, globvar_8.arr, globvar_9.arr, globvar_10.arr, + globvar_11.arr, globvar_12.arr, globvar_13.arr, globvar_14.arr, + globvar_15.arr, globvar_16.arr, globvar_17.arr, globvar_18.arr, + globvar_19.arr, globvar_20.arr, globvar_21.arr, globvar_22.arr, + globvar_23.arr, globvar_24.arr)) { return 1; } - if (fun1(globvar_7, globvar_8, globvar_9, globvar_10, globvar_1, globvar_2, globvar_3, globvar_4, globvar_5, globvar_6, globvar_7.arr, globvar_8.arr, globvar_9.arr, globvar_10.arr, globvar_1.arr, globvar_2.arr, globvar_3.arr, globvar_4.arr, globvar_5.arr, globvar_6.arr)) { + if (fun1(globvar_7, globvar_8, globvar_9, globvar_10, globvar_1, globvar_2, + globvar_3, globvar_4, globvar_5, globvar_6, globvar_7.arr, + globvar_8.arr, globvar_9.arr, globvar_10.arr, globvar_1.arr, + globvar_2.arr, globvar_3.arr, globvar_4.arr, globvar_5.arr, + globvar_6.arr)) { return 2; } - if (fun2(globvar_11, globvar_12, globvar_13, globvar_1, globvar_11.arr, globvar_12.arr, globvar_13.arr, globvar_1.arr)) { + if (fun2(globvar_11, globvar_12, globvar_13, globvar_1, globvar_11.arr, + globvar_12.arr, globvar_13.arr, globvar_1.arr)) { return 3; } - if (fun3(globvar_14, globvar_15, globvar_16, globvar_2, globvar_14.arr, globvar_15.arr, globvar_16.arr, globvar_2.arr)) { + if (fun3(globvar_14, globvar_15, globvar_16, globvar_2, globvar_14.arr, + globvar_15.arr, globvar_16.arr, globvar_2.arr)) { return 4; } - if (fun4(globvar_17, globvar_18, globvar_3, globvar_17.arr, globvar_18.arr, globvar_3.arr)) { + if (fun4(globvar_17, globvar_18, globvar_3, globvar_17.arr, globvar_18.arr, + globvar_3.arr)) { return 5; } - if (fun5(globvar_19, globvar_20, globvar_4, globvar_19.arr, globvar_20.arr, globvar_4.arr)) { + if (fun5(globvar_19, globvar_20, globvar_4, globvar_19.arr, globvar_20.arr, + globvar_4.arr)) { return 6; } - if (fun6(globvar_21, globvar_22, globvar_5, globvar_21.arr, globvar_22.arr, globvar_5.arr)) { + if (fun6(globvar_21, globvar_22, globvar_5, globvar_21.arr, globvar_22.arr, + globvar_5.arr)) { return 7; } - if (fun7(globvar_23, globvar_24, globvar_4, globvar_23.arr, globvar_24.arr, globvar_4.arr)) { + if (fun7(globvar_23, globvar_24, globvar_4, globvar_23.arr, globvar_24.arr, + globvar_4.arr)) { return 8; } - struct bytesize1 locvar_1 = { { 0 } }; + struct bytesize1 locvar_1 = {{0}}; - struct bytesize2 locvar_2 = { { 1, 2 } }; + struct bytesize2 locvar_2 = {{1, 2}}; - struct bytesize3 locvar_3 = { { 3, 4, 5 } }; + struct bytesize3 locvar_3 = {{3, 4, 5}}; - struct bytesize4 locvar_4 = { { 6, 7, 8, 9 } }; + struct bytesize4 locvar_4 = {{6, 7, 8, 9}}; - struct bytesize5 locvar_5 = { { 10, 11, 12, 13, 14 } }; + struct bytesize5 locvar_5 = {{10, 11, 12, 13, 14}}; - struct bytesize6 locvar_6 = { { 15, 16, 17, 18, 19, 20 } }; + struct bytesize6 locvar_6 = {{15, 16, 17, 18, 19, 20}}; - struct bytesize7 locvar_7 = { { 21, 22, 23, 24, 25, 26, 27 } }; + struct bytesize7 locvar_7 = {{21, 22, 23, 24, 25, 26, 27}}; - struct bytesize8 locvar_8 = { { 28, 29, 30, 31, 32, 33, 34, 35 } }; + struct bytesize8 locvar_8 = {{28, 29, 30, 31, 32, 33, 34, 35}}; - struct bytesize9 locvar_9 = { { 36, 37, 38, 39, 40, 41, 42, 43, 44 } }; + struct bytesize9 locvar_9 = {{36, 37, 38, 39, 40, 41, 42, 43, 44}}; - struct bytesize10 locvar_10 = { { 45, 46, 47, 48, 49, 50, 51, 52, 53, 54 } }; + struct bytesize10 locvar_10 = {{45, 46, 47, 48, 49, 50, 51, 52, 53, 54}}; - struct bytesize11 locvar_11 = { { 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65 } }; + struct bytesize11 locvar_11 = { + {55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65}}; - struct bytesize12 locvar_12 = { { 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77 } }; + struct bytesize12 locvar_12 = { + {66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77}}; - struct bytesize13 locvar_13 = { { 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90 } }; + struct bytesize13 locvar_13 = { + {78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90}}; - struct bytesize14 locvar_14 = { { 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104 } }; + struct bytesize14 locvar_14 = { + {91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104}}; - struct bytesize15 locvar_15 = { { 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 } }; + struct bytesize15 locvar_15 = {{105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119}}; - struct bytesize16 locvar_16 = { { 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135 } }; + struct bytesize16 locvar_16 = {{120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135}}; - struct bytesize17 locvar_17 = { { 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152 } }; + struct bytesize17 locvar_17 = {{136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152}}; - struct bytesize18 locvar_18 = { { 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170 } }; + struct bytesize18 locvar_18 = {{153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, + 170}}; - struct bytesize19 locvar_19 = { { 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189 } }; + struct bytesize19 locvar_19 = {{171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189}}; - struct bytesize20 locvar_20 = { { 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209 } }; + struct bytesize20 locvar_20 = {{190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209}}; - struct bytesize21 locvar_21 = { { 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230 } }; + struct bytesize21 locvar_21 = {{210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230}}; - struct bytesize22 locvar_22 = { { 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252 } }; + struct bytesize22 locvar_22 = {{231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252}}; - struct bytesize23 locvar_23 = { { 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 } }; + struct bytesize23 locvar_23 = {{253, 254, 255, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19}}; - struct bytesize24 locvar_24 = { { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43 } }; + struct bytesize24 locvar_24 = {{20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43}}; - if (fun0(locvar_1, locvar_2, locvar_3, locvar_4, locvar_5, locvar_6, locvar_7, locvar_8, locvar_9, locvar_10, locvar_11, locvar_12, locvar_13, locvar_14, locvar_15, locvar_16, locvar_17, locvar_18, locvar_19, locvar_20, locvar_21, locvar_22, locvar_23, locvar_24, locvar_1.arr, locvar_2.arr, locvar_3.arr, locvar_4.arr, locvar_5.arr, locvar_6.arr, locvar_7.arr, locvar_8.arr, locvar_9.arr, locvar_10.arr, locvar_11.arr, locvar_12.arr, locvar_13.arr, locvar_14.arr, locvar_15.arr, locvar_16.arr, locvar_17.arr, locvar_18.arr, locvar_19.arr, locvar_20.arr, locvar_21.arr, locvar_22.arr, locvar_23.arr, locvar_24.arr)) { + if (fun0(locvar_1, locvar_2, locvar_3, locvar_4, locvar_5, locvar_6, + locvar_7, locvar_8, locvar_9, locvar_10, locvar_11, locvar_12, + locvar_13, locvar_14, locvar_15, locvar_16, locvar_17, locvar_18, + locvar_19, locvar_20, locvar_21, locvar_22, locvar_23, locvar_24, + locvar_1.arr, locvar_2.arr, locvar_3.arr, locvar_4.arr, + locvar_5.arr, locvar_6.arr, locvar_7.arr, locvar_8.arr, + locvar_9.arr, locvar_10.arr, locvar_11.arr, locvar_12.arr, + locvar_13.arr, locvar_14.arr, locvar_15.arr, locvar_16.arr, + locvar_17.arr, locvar_18.arr, locvar_19.arr, locvar_20.arr, + locvar_21.arr, locvar_22.arr, locvar_23.arr, locvar_24.arr)) { return 1; } - if (fun1(locvar_7, locvar_8, locvar_9, locvar_10, locvar_1, locvar_2, locvar_3, locvar_4, locvar_5, locvar_6, locvar_7.arr, locvar_8.arr, locvar_9.arr, locvar_10.arr, locvar_1.arr, locvar_2.arr, locvar_3.arr, locvar_4.arr, locvar_5.arr, locvar_6.arr)) { + if (fun1(locvar_7, locvar_8, locvar_9, locvar_10, locvar_1, locvar_2, + locvar_3, locvar_4, locvar_5, locvar_6, locvar_7.arr, locvar_8.arr, + locvar_9.arr, locvar_10.arr, locvar_1.arr, locvar_2.arr, + locvar_3.arr, locvar_4.arr, locvar_5.arr, locvar_6.arr)) { return 2; } - if (fun2(locvar_11, locvar_12, locvar_13, locvar_1, locvar_11.arr, locvar_12.arr, locvar_13.arr, locvar_1.arr)) { + if (fun2(locvar_11, locvar_12, locvar_13, locvar_1, locvar_11.arr, + locvar_12.arr, locvar_13.arr, locvar_1.arr)) { return 3; } - if (fun3(locvar_14, locvar_15, locvar_16, locvar_2, locvar_14.arr, locvar_15.arr, locvar_16.arr, locvar_2.arr)) { + if (fun3(locvar_14, locvar_15, locvar_16, locvar_2, locvar_14.arr, + locvar_15.arr, locvar_16.arr, locvar_2.arr)) { return 4; } - if (fun4(locvar_17, locvar_18, locvar_3, locvar_17.arr, locvar_18.arr, locvar_3.arr)) { + if (fun4(locvar_17, locvar_18, locvar_3, locvar_17.arr, locvar_18.arr, + locvar_3.arr)) { return 5; } - if (fun5(locvar_19, locvar_20, locvar_4, locvar_19.arr, locvar_20.arr, locvar_4.arr)) { + if (fun5(locvar_19, locvar_20, locvar_4, locvar_19.arr, locvar_20.arr, + locvar_4.arr)) { return 6; } - if (fun6(locvar_21, locvar_22, locvar_5, locvar_21.arr, locvar_22.arr, locvar_5.arr)) { + if (fun6(locvar_21, locvar_22, locvar_5, locvar_21.arr, locvar_22.arr, + locvar_5.arr)) { return 7; } - if (fun7(locvar_23, locvar_24, locvar_4, locvar_23.arr, locvar_24.arr, locvar_4.arr)) { + if (fun7(locvar_23, locvar_24, locvar_4, locvar_23.arr, locvar_24.arr, + locvar_4.arr)) { return 8; } return 0; } -struct bytesize1 globvar_1 = { { 0 } }; +struct bytesize1 globvar_1 = {{0}}; -struct bytesize2 globvar_2 = { { 1, 2 } }; +struct bytesize2 globvar_2 = {{1, 2}}; -struct bytesize3 globvar_3 = { { 3, 4, 5 } }; +struct bytesize3 globvar_3 = {{3, 4, 5}}; -struct bytesize4 globvar_4 = { { 6, 7, 8, 9 } }; +struct bytesize4 globvar_4 = {{6, 7, 8, 9}}; -struct bytesize5 globvar_5 = { { 10, 11, 12, 13, 14 } }; +struct bytesize5 globvar_5 = {{10, 11, 12, 13, 14}}; -struct bytesize6 globvar_6 = { { 15, 16, 17, 18, 19, 20 } }; +struct bytesize6 globvar_6 = {{15, 16, 17, 18, 19, 20}}; -struct bytesize7 globvar_7 = { { 21, 22, 23, 24, 25, 26, 27 } }; +struct bytesize7 globvar_7 = {{21, 22, 23, 24, 25, 26, 27}}; -struct bytesize8 globvar_8 = { { 28, 29, 30, 31, 32, 33, 34, 35 } }; +struct bytesize8 globvar_8 = {{28, 29, 30, 31, 32, 33, 34, 35}}; -struct bytesize9 globvar_9 = { { 36, 37, 38, 39, 40, 41, 42, 43, 44 } }; +struct bytesize9 globvar_9 = {{36, 37, 38, 39, 40, 41, 42, 43, 44}}; -struct bytesize10 globvar_10 = { { 45, 46, 47, 48, 49, 50, 51, 52, 53, 54 } }; +struct bytesize10 globvar_10 = {{45, 46, 47, 48, 49, 50, 51, 52, 53, 54}}; -struct bytesize11 globvar_11 = { { 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65 } }; +struct bytesize11 globvar_11 = {{55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65}}; -struct bytesize12 globvar_12 = { { 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77 } }; +struct bytesize12 globvar_12 = { + {66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77}}; -struct bytesize13 globvar_13 = { { 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90 } }; +struct bytesize13 globvar_13 = { + {78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90}}; -struct bytesize14 globvar_14 = { { 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104 } }; +struct bytesize14 globvar_14 = { + {91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104}}; -struct bytesize15 globvar_15 = { { 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 } }; +struct bytesize15 globvar_15 = {{105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119}}; -struct bytesize16 globvar_16 = { { 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135 } }; +struct bytesize16 globvar_16 = {{120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135}}; -struct bytesize17 globvar_17 = { { 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152 } }; +struct bytesize17 globvar_17 = {{136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152}}; -struct bytesize18 globvar_18 = { { 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170 } }; +struct bytesize18 globvar_18 = {{153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170}}; -struct bytesize19 globvar_19 = { { 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189 } }; +struct bytesize19 globvar_19 = {{171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189}}; -struct bytesize20 globvar_20 = { { 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209 } }; +struct bytesize20 globvar_20 = {{190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209}}; -struct bytesize21 globvar_21 = { { 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230 } }; +struct bytesize21 globvar_21 = {{210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230}}; -struct bytesize22 globvar_22 = { { 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252 } }; +struct bytesize22 globvar_22 = {{231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252}}; -struct bytesize23 globvar_23 = { { 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 } }; +struct bytesize23 globvar_23 = {{253, 254, 255, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19}}; -struct bytesize24 globvar_24 = { { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43 } }; +struct bytesize24 globvar_24 = {{20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43}}; diff --git a/tests/chapter_18/valid/parameters/pass_args_on_page_boundary.c b/tests/chapter_18/valid/parameters/pass_args_on_page_boundary.c index 84bbd4e0..aaf55748 100644 --- a/tests/chapter_18/valid/parameters/pass_args_on_page_boundary.c +++ b/tests/chapter_18/valid/parameters/pass_args_on_page_boundary.c @@ -9,8 +9,8 @@ struct nine_bytes { // irregularly-sized struct that's right on a page boundary extern struct nine_bytes on_page_boundary; - -int f(struct nine_bytes in_reg, int a, int b, int c, int d, int e, struct nine_bytes stack1) { +int f(struct nine_bytes in_reg, int a, int b, int c, int d, int e, + struct nine_bytes stack1) { return in_reg.arr[2] + stack1.arr[3] + stack1.arr[8]; } diff --git a/tests/chapter_18/valid/parameters/pass_struct_and_other_args.c b/tests/chapter_18/valid/parameters/pass_struct_and_other_args.c index 94c8be74..fe6176eb 100644 --- a/tests/chapter_18/valid/parameters/pass_struct_and_other_args.c +++ b/tests/chapter_18/valid/parameters/pass_struct_and_other_args.c @@ -12,6 +12,6 @@ double foo(struct pair p, int a, int b, int c, int d, int e, int f, int g) { } int main(void) { - struct pair x = { 1, 2.0 }; + struct pair x = {1, 2.0}; return foo(x, 0, 0, 0, 0, 0, 0, 1) == 3.0; } \ No newline at end of file diff --git a/tests/chapter_18/valid/parameters/pass_struct_as_arg.c b/tests/chapter_18/valid/parameters/pass_struct_as_arg.c index dc06c8a2..6a3b9c7d 100644 --- a/tests/chapter_18/valid/parameters/pass_struct_as_arg.c +++ b/tests/chapter_18/valid/parameters/pass_struct_as_arg.c @@ -8,6 +8,6 @@ double foo(struct pair p) { } int main(void) { - struct pair x = { 1, 2.0 }; + struct pair x = {1, 2.0}; return foo(x) == 2.0; } \ No newline at end of file diff --git a/tests/chapter_18/valid/params_and_returns/cast_struct_to_void.c b/tests/chapter_18/valid/params_and_returns/cast_struct_to_void.c index d36d3d76..1bfb1cd4 100644 --- a/tests/chapter_18/valid/params_and_returns/cast_struct_to_void.c +++ b/tests/chapter_18/valid/params_and_returns/cast_struct_to_void.c @@ -1,13 +1,13 @@ struct s { - int x; + int x; }; struct s glob = {0}; struct s f(void) { - glob.x = glob.x + 1; - return glob; + glob.x = glob.x + 1; + return glob; } int main(void) { - (void)f(); - (void)f(); - return glob.x; + (void)f(); + (void)f(); + return glob.x; } \ No newline at end of file diff --git a/tests/chapter_18/valid/params_and_returns/libraries/missing_retval.c b/tests/chapter_18/valid/params_and_returns/libraries/missing_retval.c index 04eac01f..ac2a67f4 100644 --- a/tests/chapter_18/valid/params_and_returns/libraries/missing_retval.c +++ b/tests/chapter_18/valid/params_and_returns/libraries/missing_retval.c @@ -5,5 +5,5 @@ #endif struct big missing_return_value(int *i) { - *i = 10; + *i = 10; } \ No newline at end of file diff --git a/tests/chapter_18/valid/params_and_returns/libraries/missing_retval.h b/tests/chapter_18/valid/params_and_returns/libraries/missing_retval.h index f3512c12..ea5d620d 100644 --- a/tests/chapter_18/valid/params_and_returns/libraries/missing_retval.h +++ b/tests/chapter_18/valid/params_and_returns/libraries/missing_retval.h @@ -1,5 +1,5 @@ struct big { - char arr[25]; + char arr[25]; }; // make sure we correctly handle calls to functions with return values diff --git a/tests/chapter_18/valid/params_and_returns/libraries/missing_retval_client.c b/tests/chapter_18/valid/params_and_returns/libraries/missing_retval_client.c index b438bcae..2cd8d8ad 100644 --- a/tests/chapter_18/valid/params_and_returns/libraries/missing_retval_client.c +++ b/tests/chapter_18/valid/params_and_returns/libraries/missing_retval_client.c @@ -1,7 +1,7 @@ #include "missing_retval.h" int main(void) { - int array[4] = {1, 2, 3, 4}; - missing_return_value(array + 2); - return array[2] == 10; + int array[4] = {1, 2, 3, 4}; + missing_return_value(array + 2); + return array[2] == 10; } \ No newline at end of file diff --git a/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct.c b/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct.c index b12d7290..f7923c64 100644 --- a/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct.c +++ b/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct.c @@ -6,15 +6,15 @@ void exit(int status); // (e.g. returning won't clobber neighboring stack values) struct wonky change_struct(struct wonky arg) { - char *arr = arg.arr; - // first make sure it's all zero - for (int i = 0; i < 19; i = i + 1) { - if (arr[i]) { - exit(2); + char *arr = arg.arr; + // first make sure it's all zero + for (int i = 0; i < 19; i = i + 1) { + if (arr[i]) { + exit(2); + } } - } - arr[0] = 1; - arr[6] = 6; - arr[17] = -1; - return arg; + arr[0] = 1; + arr[6] = 6; + arr[17] = -1; + return arg; } \ No newline at end of file diff --git a/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct.h b/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct.h index 6f184a73..7305937c 100644 --- a/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct.h +++ b/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct.h @@ -1,6 +1,6 @@ // larger than 16 bytes but size is not divisible by 8 bytes struct wonky { - char arr[19]; + char arr[19]; }; struct wonky change_struct(struct wonky arg); \ No newline at end of file diff --git a/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct_client.c b/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct_client.c index 164c7145..0648c7da 100644 --- a/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct_client.c +++ b/tests/chapter_18/valid/params_and_returns/libraries/pass_wonky_struct_client.c @@ -1,22 +1,22 @@ #include "pass_wonky_struct.h" int main(void) { - // because this is static, it will be initialized to all zeros - static struct wonky all_zeros; + // because this is static, it will be initialized to all zeros + static struct wonky all_zeros; - struct wonky modified = change_struct(all_zeros); - if (modified.arr[0] != 1) - return 100; - if (modified.arr[6] != 6) - return 101; - if (modified.arr[17] != -1) - return 102; - for (int i = 0; i < 14; i = i + 1) { - if (i == 0 || i == 6 || i == 13) - continue; - if (modified.arr[i] != 0) - return i; - } + struct wonky modified = change_struct(all_zeros); + if (modified.arr[0] != 1) + return 100; + if (modified.arr[6] != 6) + return 101; + if (modified.arr[17] != -1) + return 102; + for (int i = 0; i < 14; i = i + 1) { + if (i == 0 || i == 6 || i == 13) + continue; + if (modified.arr[i] != 0) + return i; + } - return 0; + return 0; } \ No newline at end of file diff --git a/tests/chapter_18/valid/params_and_returns/libraries/return_calling_conventions.c b/tests/chapter_18/valid/params_and_returns/libraries/return_calling_conventions.c index 47cac197..7e33013b 100644 --- a/tests/chapter_18/valid/params_and_returns/libraries/return_calling_conventions.c +++ b/tests/chapter_18/valid/params_and_returns/libraries/return_calling_conventions.c @@ -1,81 +1,80 @@ #include "return_calling_conventions.h" struct one_int return_int_struct(void) { - struct one_int retval = {1, 2}; - return retval; + struct one_int retval = {1, 2}; + return retval; } struct twelve_bytes return_two_int_struct(void) { - struct twelve_bytes retval = {10, "12345678"}; - return retval; + struct twelve_bytes retval = {10, "12345678"}; + return retval; } struct one_xmm return_double_struct(void) { - struct one_xmm retval = {100.625}; - return retval; + struct one_xmm retval = {100.625}; + return retval; } struct two_xmm return_two_double_struct(void) { - struct two_xmm retval = {{8.8, 7.8}}; - return retval; + struct two_xmm retval = {{8.8, 7.8}}; + return retval; } struct xmm_and_int return_mixed(void) { - struct xmm_and_int retval = {{10.0}, "ab"}; - return retval; + struct xmm_and_int retval = {{10.0}, "ab"}; + return retval; } struct int_and_xmm return_mixed2(void) { - struct int_and_xmm retval = {127, 34e43}; - return retval; + struct int_and_xmm retval = {127, 34e43}; + return retval; } struct memory return_on_stack(void) { - struct memory retval = {1.25, "xy", 100l, 44}; - return retval; + struct memory retval = {1.25, "xy", 100l, 44}; + return retval; } int f(char c, double d) { - - if (c == 'p' && d == 4.56) - return 0; - return 1; + if (c == 'p' && d == 4.56) + return 0; + return 1; } struct memory pass_and_return_regs(int i, double d, struct int_and_xmm strct, char c, struct two_ints t_i, long l, struct one_int_exactly o_i_e, char c2) { - // include stack variables to make sure they don't overwrite return value - // pointer or vice versa - int local1 = i * 2; - double local2 = d * 2; - struct memory retval = {0, {0, 0, 0}, 0, 0}; + // include stack variables to make sure they don't overwrite return value + // pointer or vice versa + int local1 = i * 2; + double local2 = d * 2; + struct memory retval = {0, {0, 0, 0}, 0, 0}; - if (local1 != 12 || local2 != 8.0) { - retval.i = 1; - return retval; - } - int local3 = f(strct.c, strct.d); - if (local3) { - retval.i = 2; - return retval; - } - if (c != 5) { - retval.i = 3; - return retval; - } - if (t_i.c != '_' || t_i.arr[0] != 5 || t_i.arr[1] != 6 || t_i.arr[2] != 7) { - retval.i = 4; - return retval; - } - if (l != 77) { - retval.i = 5; - return retval; - } - if (o_i_e.l != 567890) { - retval.i = 6; - return retval; - } - if (c2 != 99) { - retval.i = 7; + if (local1 != 12 || local2 != 8.0) { + retval.i = 1; + return retval; + } + int local3 = f(strct.c, strct.d); + if (local3) { + retval.i = 2; + return retval; + } + if (c != 5) { + retval.i = 3; + return retval; + } + if (t_i.c != '_' || t_i.arr[0] != 5 || t_i.arr[1] != 6 || t_i.arr[2] != 7) { + retval.i = 4; + return retval; + } + if (l != 77) { + retval.i = 5; + return retval; + } + if (o_i_e.l != 567890) { + retval.i = 6; + return retval; + } + if (c2 != 99) { + retval.i = 7; + return retval; + } + retval.l = 100; return retval; - } - retval.l = 100; - return retval; } \ No newline at end of file diff --git a/tests/chapter_18/valid/params_and_returns/libraries/return_calling_conventions_client.c b/tests/chapter_18/valid/params_and_returns/libraries/return_calling_conventions_client.c index 18bdb563..607fd4bc 100644 --- a/tests/chapter_18/valid/params_and_returns/libraries/return_calling_conventions_client.c +++ b/tests/chapter_18/valid/params_and_returns/libraries/return_calling_conventions_client.c @@ -1,55 +1,57 @@ #include "return_calling_conventions.h" int main(void) { - struct one_int_exactly one_long = {567890l}; - struct two_ints two_ints = {'_', {5, 6, 7}}; - struct int_and_xmm int_and_xmm = {'p', 4.56}; - - // returning structures - - struct one_int s1 = return_int_struct(); - if (s1.i != 1 || s1.c != 2) { - return 26; - } - - struct twelve_bytes s2 = return_two_int_struct(); - if (s2.i != 10 || strncmp(s2.arr, "12345678", sizeof s2.arr)) - return 27; - - struct one_xmm s3 = return_double_struct(); - if (s3.d != 100.625) - return 28; - struct two_xmm s4 = return_two_double_struct(); - if (s4.d[0] != 8.8 || s4.d[1] != 7.8) - return 29; - - struct xmm_and_int s5 = return_mixed(); - if (s5.dbl.d != 10.0 || strcmp(s5.c, "ab")) - return 30; - - struct int_and_xmm s6 = return_mixed2(); - if (s6.c != 127 || s6.d != 34e43) - return 31; - - struct memory s7 = return_on_stack(); - if (s7.d != 1.25 || strcmp(s7.c, "xy") || s7.l != 100l || s7.i != 44) - return 32; - - // call return_on_stack again and ignore the value; make sure we still allocate space for it - return_on_stack(); - - s7 = pass_and_return_regs(6, 4.0, int_and_xmm, 5, two_ints, 77, one_long, 99); - // something was clobbered or set incorrectly in retval - if (s7.d || s7.c[0] || s7.c[1] || s7.c[2]) - return 33; - - // i was set to indicate problem w/ parameter passing - if (s7.i) - return 100 + s7.i; - - if (s7.l != 100) - return 34; // l field was clobbered or set incorrectly - - // success! - return 0; + struct one_int_exactly one_long = {567890l}; + struct two_ints two_ints = {'_', {5, 6, 7}}; + struct int_and_xmm int_and_xmm = {'p', 4.56}; + + // returning structures + + struct one_int s1 = return_int_struct(); + if (s1.i != 1 || s1.c != 2) { + return 26; + } + + struct twelve_bytes s2 = return_two_int_struct(); + if (s2.i != 10 || strncmp(s2.arr, "12345678", sizeof s2.arr)) + return 27; + + struct one_xmm s3 = return_double_struct(); + if (s3.d != 100.625) + return 28; + struct two_xmm s4 = return_two_double_struct(); + if (s4.d[0] != 8.8 || s4.d[1] != 7.8) + return 29; + + struct xmm_and_int s5 = return_mixed(); + if (s5.dbl.d != 10.0 || strcmp(s5.c, "ab")) + return 30; + + struct int_and_xmm s6 = return_mixed2(); + if (s6.c != 127 || s6.d != 34e43) + return 31; + + struct memory s7 = return_on_stack(); + if (s7.d != 1.25 || strcmp(s7.c, "xy") || s7.l != 100l || s7.i != 44) + return 32; + + // call return_on_stack again and ignore the value; make sure we still + // allocate space for it + return_on_stack(); + + s7 = pass_and_return_regs(6, 4.0, int_and_xmm, 5, two_ints, 77, one_long, + 99); + // something was clobbered or set incorrectly in retval + if (s7.d || s7.c[0] || s7.c[1] || s7.c[2]) + return 33; + + // i was set to indicate problem w/ parameter passing + if (s7.i) + return 100 + s7.i; + + if (s7.l != 100) + return 34; // l field was clobbered or set incorrectly + + // success! + return 0; } \ No newline at end of file diff --git a/tests/chapter_18/valid/params_and_returns/libraries/retval_struct_sizes.c b/tests/chapter_18/valid/params_and_returns/libraries/retval_struct_sizes.c index 5268418c..26929638 100644 --- a/tests/chapter_18/valid/params_and_returns/libraries/retval_struct_sizes.c +++ b/tests/chapter_18/valid/params_and_returns/libraries/retval_struct_sizes.c @@ -1,75 +1,75 @@ #include "retval_struct_sizes.h" -struct bytesize1 fun1 (void) { +struct bytesize1 fun1(void) { return globvar_1; } -struct bytesize2 fun2 (void) { +struct bytesize2 fun2(void) { return globvar_2; } -struct bytesize3 fun3 (void) { +struct bytesize3 fun3(void) { return globvar_3; } -struct bytesize4 fun4 (void) { +struct bytesize4 fun4(void) { return globvar_4; } -struct bytesize5 fun5 (void) { +struct bytesize5 fun5(void) { return globvar_5; } -struct bytesize6 fun6 (void) { +struct bytesize6 fun6(void) { return globvar_6; } -struct bytesize7 fun7 (void) { +struct bytesize7 fun7(void) { return globvar_7; } -struct bytesize8 fun8 (void) { +struct bytesize8 fun8(void) { return globvar_8; } -struct bytesize9 fun9 (void) { +struct bytesize9 fun9(void) { return globvar_9; } -struct bytesize10 fun10 (void) { +struct bytesize10 fun10(void) { return globvar_10; } -struct bytesize11 fun11 (void) { +struct bytesize11 fun11(void) { return globvar_11; } -struct bytesize12 fun12 (void) { +struct bytesize12 fun12(void) { return globvar_12; } -struct bytesize13 fun13 (void) { +struct bytesize13 fun13(void) { return globvar_13; } -struct bytesize14 fun14 (void) { +struct bytesize14 fun14(void) { return globvar_14; } -struct bytesize15 fun15 (void) { +struct bytesize15 fun15(void) { return globvar_15; } -struct bytesize16 fun16 (void) { +struct bytesize16 fun16(void) { return globvar_16; } -struct bytesize17 fun17 (void) { +struct bytesize17 fun17(void) { return globvar_17; } -struct bytesize18 fun18 (void) { +struct bytesize18 fun18(void) { return globvar_18; } -struct bytesize19 fun19 (void) { +struct bytesize19 fun19(void) { return globvar_19; } -struct bytesize20 fun20 (void) { +struct bytesize20 fun20(void) { return globvar_20; } -struct bytesize21 fun21 (void) { +struct bytesize21 fun21(void) { return globvar_21; } -struct bytesize22 fun22 (void) { +struct bytesize22 fun22(void) { return globvar_22; } -struct bytesize23 fun23 (void) { +struct bytesize23 fun23(void) { return globvar_23; } -struct bytesize24 fun24 (void) { +struct bytesize24 fun24(void) { return globvar_24; } diff --git a/tests/chapter_18/valid/params_and_returns/libraries/retval_struct_sizes_client.c b/tests/chapter_18/valid/params_and_returns/libraries/retval_struct_sizes_client.c index aa8891e7..52c83eca 100644 --- a/tests/chapter_18/valid/params_and_returns/libraries/retval_struct_sizes_client.c +++ b/tests/chapter_18/valid/params_and_returns/libraries/retval_struct_sizes_client.c @@ -3,7 +3,6 @@ int memcmp(void *s1, void *s2, unsigned long n); int main(void) { - struct bytesize1 s1 = fun1(); if (memcmp(&s1, &globvar_1, sizeof s1)) { return 1; @@ -127,50 +126,69 @@ int main(void) { return 0; } -struct bytesize1 globvar_1 = { { 0 } }; +struct bytesize1 globvar_1 = {{0}}; -struct bytesize2 globvar_2 = { { 1, 2 } }; +struct bytesize2 globvar_2 = {{1, 2}}; -struct bytesize3 globvar_3 = { { 3, 4, 5 } }; +struct bytesize3 globvar_3 = {{3, 4, 5}}; -struct bytesize4 globvar_4 = { { 6, 7, 8, 9 } }; +struct bytesize4 globvar_4 = {{6, 7, 8, 9}}; -struct bytesize5 globvar_5 = { { 10, 11, 12, 13, 14 } }; +struct bytesize5 globvar_5 = {{10, 11, 12, 13, 14}}; -struct bytesize6 globvar_6 = { { 15, 16, 17, 18, 19, 20 } }; +struct bytesize6 globvar_6 = {{15, 16, 17, 18, 19, 20}}; -struct bytesize7 globvar_7 = { { 21, 22, 23, 24, 25, 26, 27 } }; +struct bytesize7 globvar_7 = {{21, 22, 23, 24, 25, 26, 27}}; -struct bytesize8 globvar_8 = { { 28, 29, 30, 31, 32, 33, 34, 35 } }; +struct bytesize8 globvar_8 = {{28, 29, 30, 31, 32, 33, 34, 35}}; -struct bytesize9 globvar_9 = { { 36, 37, 38, 39, 40, 41, 42, 43, 44 } }; +struct bytesize9 globvar_9 = {{36, 37, 38, 39, 40, 41, 42, 43, 44}}; -struct bytesize10 globvar_10 = { { 45, 46, 47, 48, 49, 50, 51, 52, 53, 54 } }; +struct bytesize10 globvar_10 = {{45, 46, 47, 48, 49, 50, 51, 52, 53, 54}}; -struct bytesize11 globvar_11 = { { 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65 } }; +struct bytesize11 globvar_11 = {{55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65}}; -struct bytesize12 globvar_12 = { { 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77 } }; +struct bytesize12 globvar_12 = { + {66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77}}; -struct bytesize13 globvar_13 = { { 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90 } }; +struct bytesize13 globvar_13 = { + {78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90}}; -struct bytesize14 globvar_14 = { { 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104 } }; +struct bytesize14 globvar_14 = { + {91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104}}; -struct bytesize15 globvar_15 = { { 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 } }; +struct bytesize15 globvar_15 = {{105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119}}; -struct bytesize16 globvar_16 = { { 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135 } }; +struct bytesize16 globvar_16 = {{120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135}}; -struct bytesize17 globvar_17 = { { 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152 } }; +struct bytesize17 globvar_17 = {{136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152}}; -struct bytesize18 globvar_18 = { { 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170 } }; +struct bytesize18 globvar_18 = {{153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170}}; -struct bytesize19 globvar_19 = { { 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189 } }; +struct bytesize19 globvar_19 = {{171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189}}; -struct bytesize20 globvar_20 = { { 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209 } }; +struct bytesize20 globvar_20 = {{190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209}}; -struct bytesize21 globvar_21 = { { 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230 } }; +struct bytesize21 globvar_21 = {{210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230}}; -struct bytesize22 globvar_22 = { { 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252 } }; +struct bytesize22 globvar_22 = {{231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252}}; -struct bytesize23 globvar_23 = { { 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 } }; +struct bytesize23 globvar_23 = {{253, 254, 255, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19}}; -struct bytesize24 globvar_24 = { { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43 } }; +struct bytesize24 globvar_24 = {{20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43}}; diff --git a/tests/chapter_18/valid/params_and_returns/pass_and_return_struct.c b/tests/chapter_18/valid/params_and_returns/pass_and_return_struct.c index 818da7b1..ef7f6356 100644 --- a/tests/chapter_18/valid/params_and_returns/pass_and_return_struct.c +++ b/tests/chapter_18/valid/params_and_returns/pass_and_return_struct.c @@ -9,7 +9,7 @@ struct pair add_to_x(struct pair p) { } int main(void) { - struct pair arg = { 1, 4 }; + struct pair arg = {1, 4}; struct pair result = add_to_x(arg); return result.x + arg.x + result.y; } \ No newline at end of file diff --git a/tests/chapter_18/valid/params_and_returns/return_incomplete_type.c b/tests/chapter_18/valid/params_and_returns/return_incomplete_type.c index 0f1b64a6..392d9341 100644 --- a/tests/chapter_18/valid/params_and_returns/return_incomplete_type.c +++ b/tests/chapter_18/valid/params_and_returns/return_incomplete_type.c @@ -12,6 +12,6 @@ int main(void) { } struct s return_struct(void) { - struct s result = { 1, 2 }; + struct s result = {1, 2}; return result; } \ No newline at end of file diff --git a/tests/chapter_18/valid/params_and_returns/return_struct.c b/tests/chapter_18/valid/params_and_returns/return_struct.c index 5d005774..52814863 100644 --- a/tests/chapter_18/valid/params_and_returns/return_struct.c +++ b/tests/chapter_18/valid/params_and_returns/return_struct.c @@ -4,7 +4,7 @@ struct pair { }; struct pair return_pair(void) { - struct pair ret = { 1, 11l }; + struct pair ret = {1, 11l}; return ret; } diff --git a/tests/chapter_18/valid/params_and_returns/temporary_lifetime.c b/tests/chapter_18/valid/params_and_returns/temporary_lifetime.c index 722cec7e..fed7e197 100644 --- a/tests/chapter_18/valid/params_and_returns/temporary_lifetime.c +++ b/tests/chapter_18/valid/params_and_returns/temporary_lifetime.c @@ -5,22 +5,22 @@ // TODO make this explicitly based on Listing 18-27? struct inner { - int a; - int b; + int a; + int b; }; struct contains_array { - struct inner array[4]; + struct inner array[4]; }; struct contains_array get_struct(void) { - struct inner obj = {1, 2}; - struct inner obj2 = {3, 4}; - struct contains_array result = {{obj, obj2, obj}}; - return result; + struct inner obj = {1, 2}; + struct inner obj2 = {3, 4}; + struct contains_array result = {{obj, obj2, obj}}; + return result; } int main(void) { - int i = get_struct().array[2].a; - return i; + int i = get_struct().array[2].a; + return i; } \ No newline at end of file