diff options
author | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-12 22:06:47 +0000 |
---|---|---|
committer | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-12 22:06:47 +0000 |
commit | e60a6f7b6c12183ca32dfe2876f09f4b4f4f69c1 (patch) | |
tree | 67f495ddc3964a90084152e177995da72e7bce30 /gcc/testsuite | |
parent | fe1328da42d69dc04d95784b2b8d4c922382c67c (diff) | |
download | gcc-e60a6f7b6c12183ca32dfe2876f09f4b4f4f69c1.tar.gz |
gcc/java/
* java-gimplify.c (java_gimplify_block): New argument to
build_empty_stmt.
* expr.c (force_evaluation_order): Same.
* typeck.c: Add location to build_decl or PUSH_FIELD calls.
* class.c: Same.
* decl.c: Same.
* jcf-parse.c: Same.
* constants.c: Same.
* resource.c: Same.
* except.c: Same.
* builtins.c: Same.
* expr.c: Same.
* java-tree.h (PUSH_FIELD): Add location field.
gcc/objc/
* objc-act.c (finish_var_decl): Pass location to finish_decl.
(objc_get_parm_info): Same.
(get_super_receiver): Same.
* objc-act.c (objc_build_component_ref): Pass location to
build_compound_ref.
(build_module_initializer_routine): Pass location to
c_end_compound_stmt.
(objc_generate_static_init_call): Pass location to build_stmt.
(build_typed_selector_reference): New location argument.
(build_selector_reference): Same.
(objc_substitute_decl): Pass location to build_array_ref.
(next_sjlj_build_try_catch_finally): Pass location to build_stmt.
(objc_begin_catch_clause): Same.
(objc_finish_try_stmt): Same.
(objc_finish_catch_clause): Pass location to c_end_compound_stmt.
(objc_build_throw_stmt): New argument.
(generate_shared_structures): Pass location to build_c_cast.
(objc_build_message_expr): Use local location.
(objc_finish_message_expr): Use input_location.
(build_objc_method_call): New argument.
(objc_build_selector_expr): Same.
(get_super_receiver): Pass location to build_c_cast,
build_modify_expr, build_compound_expr.
* objc-act.c: Add location to all calls to start_struct, build_decl,
finish_struct.
gcc/
* tree-pretty-print.c (dump_generic_node): Dump column numbers.
* gimple-pretty-print.c (dump_gimple_stmt): Same.
* gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs
created.
* c-parser.c (c_parser_binary_expression): Use current column while
building binary operations.
* common.opt (fshow-column): Enable by default.
* tree-vrp.c (check_array_ref): Use warning_at.
(check_array_bounds): Use location from call back if expr has no
location.
* tree.h: Add location argument to maybe_fold_*.
* tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*.
(maybe_fold_offset_to_array_ref): Add location argument and use it.
(maybe_fold_offset_to_component_ref): Same.
(maybe_fold_offset_to_reference): Same.
(maybe_fold_offset_to_address): Same.
(maybe_fold_stmt_indirect): Same.
(maybe_fold_stmt_addition): Same.
(fold_stmt_r): Pass location to maybe_fold_*.
(fold_gimple_assign): Same.
* c-tree.h: Add location argument to finish_decl,
default_function_array_conversion, store_init_value.
* c-decl.c (define_label): Use error_at.
(c_make_fname_decl): Pass location to finish_decl.
(finish_decl): New location argument.
(build_compound_literal): Pass location to store_init_value.
(grokdeclarator): Pass location to finish_decl.
(grokfield): Same.
* c-typeck.c (array_to_pointer_conversion): New location argument.
(function_to_pointer_conversion): Same.
(default_function_array_conversion): Same.
(parser_build_unary_op): Pass location to overflow_warning.
(parser_build_binary_op): Same. Use warning_at.
(build_unary_op): Pass location to array_to_pointer_conversion.
(build_c_cast): Pass location to digest_init.
(build_modify_expr): New location argument.
(convert_for_assignment): Same.
(store_init_value): Same.
(digest_init): Same.
(output_init_element): Pass location to digest_init and
array_to_pointer_conversion.
(c_finish_return): Pass location to convert_for_assignment.
* gimplify.c (gimplify_conversion): Pass location to
maybe_fold_offset_to_address.
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location
to maybe_fold_stmt_addition.
* c-omp.c (c_finish_omp_atomic): Pass new location to
build_modify_expr.
(c_finish_omp_for): Same.
* c-common.c (overflow_warning): New argument.
* c-common.h: New argument to build_modify_expr, overflow_warning.
* c-parser.c (c_parser_declaration_or_fndef): Pass location to
finish_decl.
(c_parser_initializer): Pass location to
default_function_array_conversion.
(c_parser_initelt): Same.
(c_parser_initval): Same.
(c_parser_asm_operands): Same.
(c_parser_expr_no_commas): Same. Pass location to build_modify_expr.
(c_parser_conditional_expression): Same.
(c_parser_binary_expression): Add location info to stack. Use it.
(c_parser_unary_expression): Pass location to
default_function_array_conversion, parser_build_unary_op,
build_indirect_ref, c_parser_postfix_expression_after_primary.
(c_parser_postfix_expression_after_primary): New location argument.
Use it.
(c_parser_expression_conv): Pass location to
default_function_array_conversion.
(c_parser_expr_list): Same.
(c_parser_omp_atomic): Same.
(c_parser_omp_for_loop): Same.
* c-tree.h: (struct c_declarator): Add comment to id_loc.
(build_array_declarator): New argument.
* c-decl.c (build_array_declarator): Add location argument.
(grokdeclarator): Set id_loc for cdk_array.
* c-parser.c (c_parser_direct_declarator_inner): Pass location to
build_array_declarator.
* tree.c (build_omp_clause): Add location argument.
* tree.h (OMP_CLAUSE_HAS_LOCATION): New macro.
(OMP_CLAUSE_LOCATION): New macro.
(struct tree_omp_clause): Add location field.
(build_omp_clause): Add argument.
* testsuite/gcc.dg/gomp/for-1.c: Fix column.
* cp/pt.c (tsubst_omp_for_iterator): Pass location to
build_omp_clause.
* cp/parser.c (cp_parser_omp_var_list_no_open): Same.
(cp_parser_omp_clause_collapse): Same.
(cp_parser_omp_clause_default): Same.
(cp_parser_omp_clause_if): Same.
(cp_parser_omp_clause_nowait): Same.
(cp_parser_omp_clause_num_threads): Same.
(cp_parser_omp_clause_ordered): Same.
(cp_parser_omp_clause_schedule): Same.
(cp_parser_omp_clause_untied): Same.
(cp_parser_omp_for_loop): Same.
(cp_parser_omp_parallel): Pass location to c_split_parallel_clauses.
* c-tree.h (c_start_case): Add location argument.
(c_process_expr_stmt): Same.
(c_finish_goto_*): Same.
* tree-parloops.c (initialize_reductions): Pass location to
build_omp_clause.
(create_parallel_loop): Same.
* fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same.
(gfc_trans_omp_reduction_list): Same.
(gfc_trans_omp_clauses): Same.
(gfc_trans_omp_do): Same.
* c-typeck.c (c_finish_goto_label): Same.
(c_finish_goto_ptr): New location argument.
(c_start_case): Same.
(emit_side_effect_warnings): Same.
(c_process_expr_stmt): Same.
(c_finish_stmt_expr): Same.
(c_finish_omp_clauses): Use error_at instead of error.
* gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to
build_omp_clause.
* c-omp.c (c_split_parallel_clauses): New location argument.
* tree-nested.c (convert_nonlocal_reference_stmt): Pass location
to build_omp_clause.
(convert_local_reference_stmt): Same.
(convert_gimple_call): Same.
* c-common.h (c_split_parallel_clauses): New argument.
* c-parser.c (c_parser_statement_after_labels): Pass location to
c_finish_goto_label.
(c_parser_switch_statement): Pass location to c_start_case.
(c_parser_for_statement): Pass location to c_finish_expr_stmt,
and c_process_expr_stmt.
(c_parser_omp_variable_list): Add location argument.
(c_parser_omp_clause_collapse): Pass location to
build_omp_clause.
(c_parser_omp_clause_default): Same.
(c_parser_omp_clause_if): Same.
(c_parser_omp_clause_num_threads): Same.
(-c_parser_omp_clause_ordered): Same.
(c_parser_omp_clause_reduction): Pass location to
c_parser_omp_variable_list.
(c_parser_omp_clause_schedule): Pass location to build_omp_clause.
(c_parser_omp_clause_untied): Same.
(c_parser_omp_for_loop): Pass location to c_process_expr_stmt.
(c_parser_omp_parallel): Pass location to
c_split_parallel_clauses.
* c-tree.h (check_for_loop_decls, undeclared_variable,
build_component_ref, build_array_ref, build_external_ref,
c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op,
build_conditional_expr, build_compound_expr, c_cast_expr,
build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr,
c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New
argument.
* c-semantics.c (build_stmt): Same.
(build_case_label): Same.
* c-decl.c (c_finish_incomplete_decl): Pass location on down.
(undeclared_variable): New argument.
(make_label): Same.
(lookup_label): Pass location on down.
(define_label): Same.
(finish_decl): Same.
(build_compound_literal): Same.
(finish_struct): Same.
(finish_function): Do not set location here.
(check_for_loop_decls): New argument.
* tree.c (save_expr): Set location.
(build_empty_stmt): New argument.
* tree.h (build_empty_stmt): New argument to build_empty_stmt.
(CAN_HAVE_LOCATION_P): Make sure we have a non empty node.
* builtins.c (gimplify_va_arg_expr): Use locations.
(expand_builtin_sync_operation): Same.
* c-typeck.c (build_component_ref): New argument.
(build_array_ref): Same.
(build_external_ref): Same.
(c_expr_sizeof_expr): Same.
(c_expr_sizeof_type): Same.
(parser_build_unary_op): Same.
(build_conditional_expr): Same.
(build_compound_expr): Pass location on down.
(build_compound_expr): New argument.
(build_c_cast): Same.
(c_cast_expr): Same.
(build_asm_expr): Same.
(c_finish_return): Same.
(c_process_expr_stmt): Pass location on down.
(c_finish_stmt_expr): New argument.
(push_clenaup): Same.
(c_finish_omp_parallel): Same.
(c_finish_omp_task): Same.
* gimplify.c (gimplify_call_expr): Pass location on down.
* c-omp.c (c_finish_omp_master): New argument.
(c_finish_omp_critical): Same.
(c_finish_omp_ordered): Same.
(c_finish_omp_barrier): Same.
(-c_finish_omp_taskwait): Same.
(c_finish_omp_atomic): Same.
(c_finish_omp_flush): Same.
* tree-inline.c (copy_tree_body_r): Pass location on down.
(inline_forbidden_p): Remove use of input_location.
* c-gimplify.c (c_build_bind_expr): New argument.
* c-common.c (c_common_truthvalue_conversion): Pass location on down.
(c_sizeof_or_alignof_type): New argument.
(c_alignof_expr): Same.
(build_va_arg): Same.
(c_add_case_label): Same.
* c-common.h (c_sizeof_or_alignof_type, c_alignof_expr,
c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label,
c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt,
c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered,
c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush,
c_finish_omp_taskwait, c_finish_omp_for, c_split_parallel_clauses):
New argument.
* stub-objc.c (objc_build_selector_expr): Same.
(objc_build_throw_stmt): Same.
* c-parser.c (c_parser_declaration_or_fndef): Pass location on down.
(c_parser_initelt): Same.
(c_parser_compound_statement): Same.
(c_parser_compound_statement_nostart): Same.
(c_parser_label): Same.
(c_parser_statement_after_labels): Same.
(c_parser_if_body): Same.
(c_parser_else_body): Same.
(c_parser_if_statement): Same.
(c_parser_switch_statement): Same.
(c_parser_while_statement): Same.
(c_parser_do_statement): Same.
(c_parser_for_statement): Same.
(c_parser_asm_statement): Same.
(c_parser_conditional_expression): Same.
(c_parser_binary_expression): Same.
(c_parser_cast_expression): Same.
(c_parser_unary_expression): Same.
(c_parser_sizeof_expression): Same.
(c_parser_alignof_expression): Same.
(c_parser_postfix_expression): Same.
(c_parser_expression): Same.
(c_parser_objc_receiver): Same.
(c_parser_omp_variable_list): Same.
(c_parser_omp_structured_block): Same.
(c_parser_omp_atomic): New argument.
(c_parser_omp_barrier): Same.
(c_parser_omp_critical): Same.
(c_parser_omp_flush): Pass location on down.
(c_parser_omp_for_loop): New argument.
(c_parser_omp_for): Same.
(c_parser_omp_master): Same.
(c_parser_omp_ordered): Same.
(c_parser_omp_sections_scope): Same.
(c_parser_omp_sections): Same.
(c_parser_omp_parallel): Same.
(c_parser_omp_single): Same.
(c_parser_omp_task): Same.
(c_parser_omp_taskwait): Pass location on down.
(c_parser_omp_construct): Same.
(c_parser_omp_threadprivate): Same.
* dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h,
builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c,
tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c,
c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c,
c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c,
emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c,
rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h,
tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c,
config/i386/i386.c, stmt.c:
Add location argument to the following function definitions and/or
function calls: build_decl, objcp_start_struct, objcp_finish_struct,
start_struct, finish_struct, PUSH_FIELD, create_artificial_label,
cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl,
build_compound_literal, parser_xref_tag, resolve_overloaded_builtin,
do_case, c_finish_bc_stmt, build_compound_literal,
build_function_call.
* c-decl.c (build_compound_literal): Add location argument.
Make all diagnostic calls use location.
(start_struct): Same.
(finish_struct): Same.
(start_enum): Same.
(build_enumerator): Same.
(start_function): Same.
(grokdeclarator): Make all diagnostic calls use location.
(store_parm_decls_oldstyle): Same.
* c-typeck.c (build_function_call): Add location argument.
Make all diagnostic calls use location.
(do_case): Same.
(c_finish_bc_stmt): Same.
* tree-nested.c (get_trampoline_type): Add argument.
Pass location to build_decl.
(lookup_tramp_for_decl): Pass location to get_trampoline_type.
* rtl.h (RTL_LOCATION): New.
* c-common.c (c_add_case_label): Add location argument.
Make all diagnostic calls use location.
* c-common.h: Add location argument to make_fname_decl, do_case,
c_add_case_label, build_function_call, resolve_overloaded_builtin.
* c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc.
Set it appropriately for every case. Pass enum_loc to start_enum
call. Pass value_loc first to build_enumerator. Pass enum_loc to
parser_xref_tag.
(c_parser_struct_or_union_specifier): Save location. Use it for
start_struct, finish_struct, and parser_xref_tag.
gcc/testsuite/
* gcc.dg/old-style-prom-3.c: Add column info.
* gcc.dg/overflow-warn-1.c
* gcc.dg/gomp/pr27415.c
* gcc.dg/gomp/for-1.c: Same.
* gcc.dg/enum-compat-1.c: Same.
* gcc.dg/c99-tag-3.c: Same.
* gcc.dg/Wredundant-decls-2.c: Same.
* gcc.dg/func-ptr-conv-1.c: Same.
* gcc.dg/asm-wide-1.c: Same.
* gcc.dg/nofixed-point-2.c: Same.
* gcc.dg/cpp/line3.c: Same.
* gcc.dg/array-10.c: Same.
* gcc.dg/c99-vla-jump-1.c: Same.
* gcc.dg/pr20368-1.c: Same.
* gcc.dg/Wshadow-3.c: Same.
* gcc.dg/c90-const-expr-8.c: Same.
* gcc.dg/label-decl-2.c: Same.
* gcc.dg/dremf-type-compat-2.c: Same.
* gcc.dg/c90-const-expr-5.c: Same.
* gcc.dg/builtins-30.c: Same.
* gcc.dg/Warray-bounds.c: Same.
* gcc.dg/Wcxx-compat-2.c: Same.
* gcc.dg/tree-ssa/col-1.c: Same.
* gcc.dg/old-style-prom-2.c: Same.
* gcc.dg/cast-function-1.c: Same.
* gcc.dg/pr15698-1.c: Same.
* gcc.dg/dremf-type-compat-3.c: Same.
* gcc.dg/vla-8.c: Same.
* gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct
line.
* gcc.dg/label-decl-2.c: Move label diagnostic to correct line.
* gcc.dg/old-style-prom-3.c: Check for error on the correct line.
* gcc.dg/enum-compat-1.c: Same.
* gcc.dg/dremf-type-compat-2.c: Same.
* gcc.dg/old-style-prom-2.c: Same.
* gcc.dg/pr15698-1.c: Same.
* gcc.dg/pr20368-1.c: Same.
* gcc.dg/dremf-type-compat-3.c: Same.
* gcc.dg/builtins-30.c: Same. Test for columns.
gcc/objcp/
* objcp-decl.h (c_end_compound_stmt): New argument.
* objcp-decl.c (objcp_start_struct): Add argument.
(objcp_finish_struct): Same.
gcc/cp/
* typeck.c (cp_build_binary_op): Pass location to overflow_warning.
(build_modify_expr): New arg.
* semantics.c (finish_unary_op_expr): Pass location to
overflow_warning.
(handle_omp_for_class_iterator): Pass location to build_modify_expr.
* typeck.c (cxx_sizeof_or_alignof_type): Pass location to
c_sizeof_or_alignof_type.
(build_array_ref): New argument.
(build_compound_expr): Same.
(build_const_cast): Same.
(build_ptrmemfunc): Pass location to build_c_cast.
* init.c (avoid_placement_new_aliasing): Pass location to
build_stmt.
(build_vec_delete_1): Pass location to cp_build_modify_expr,
build_compound_expr.
* class.c (build_vtbl_ref_1): Pass location to build_array_ref.
* decl.c (poplevel): Pass location to c_build_bind_expr.
(finish_case_label): Pass location to build_case_label.
(finish_constructor_body): Same.
(finish_destructor_body): Pass location to build_stmt.
(cxx_maybe_build_cleanup): Same, but to build_compound_expr.
* call.c (build_new_op): Pass location to build_array_ref.
(build_x_va_arg): Pass location to build_va_arg.
* except.c (expand_end_catch_block): Pass location to
build_stmt.
* cp-tree.h (build_array_ref): New argument.
(build_compound_expr): Same.
(build_c_cast): Same.
* cp-gimplify.c (gimplify_if_stmt): Pass location on down.
(gimplify_switch_stmt): Same.
* typeck2.c (split_nonconstant_init_1): Same.
* pt.c (tsubst_copy): Same.
* semantics.c (add_decl_expr): Same.
(do_poplevel): Same.
(push_cleanup): Same.
(finish_goto_stmt): Same.
(finish_expr_stmt): Same.
(begin_if_stmt): Same.
(begin_while_stmt): Same.
(begin_do_stmt): Same.
(finish_return_stmt): Same.
(begin_for_stmt): Same.
(finish_break_stmt): Same.
(finish_continue_stmt): Same.
(begin_switch_stmt): Same.
(begin_try_block): Same.
(begin_handler): Same.
(finish_asm_stmt): Same.
(finish_label_stmt): Same.
(finish_stmt_expr_expr): Same.
(finalize_nrv_r): Same.
(finish_omp_atomic): Same.
* name-lookup.c (do_using_directive): Same.
* decl2.c (grok_array_decl): Same.
* parser.c (cp_parser_cast_expression): Same.
(cp_parser_selection_statement): Same.
(cp_parser_implicitly_scoped_statement): Same.
(cp_parser_objc_selector_expression): Same.
(cp_parser_objc_synchronized_statement): Same.
(cp_parser_objc_throw_statement): Same.
(cp_parser_omp_critical): Same.
(cp_parser_omp_master): Same.
* typeck.c (build_function_call): Add location argument.
* init.c: Add location argument to all build_decl calls.
* class.c: Same.
* method.c: Same.
* rtti.c: Same.
* tree.c: Same.
* pt.c: Same.
* semantics.c: Same.
* lex.c: Same.
* decl2.c: Same.
* cp-gimplify.c: Same.
* decl.c: Same.
(cp_make_fname_decl): Add location argument. Pass location ot
build_decl.
(finish_case_label): Same.
* cp-tree.h (finish_case_label): Add location argument.
* parser.c (cp_parser_label_for_labeled_statement): Pass location to
finish_case_label.
gcc/fortran/
* trans-array.c (gfc_trans_allocate_array_storage): Pass
location on down.
(gfc_trans_array_constructor_value): Same.
(gfc_trans_scalarized_loop_end): Same.
(gfc_conv_ss_startstride): Same.
(gfc_trans_g77_array): Same.
(gfc_trans_dummy_array_bias): Same.
(gfc_conv_array_parameter): Same.
(structure_alloc_comps): Same.
* trans-expr.c (gfc_conv_function_call): Same.
(fill_with_spaces): Same.
(gfc_trans_string_copy): Same.
(gfc_trans_scalar_assign): Same.
* trans-stmt.c (gfc_trans_goto): Same.
(gfc_trans_if_1): Same.
(gfc_trans_simple_do): Same.
(gfc_trans_do): Same.
(gfc_trans_do_while): Same.
(gfc_trans_logical_select): Same.
(gfc_trans_select): Same.
(gfc_trans_forall_loop): Same.
(gfc_trans_nested_forall_loop): Same.
(generate_loop_for_temp_to_lhs): Same.
(generate_loop_for_rhs_to_temp): Same.
(gfc_trans_forall_1): Same.
(gfc_trans_where_assign): Same.
(gfc_trans_where_3): Same.
(gfc_trans_allocate): Same.
* trans.c (gfc_finish_block): Same.
(gfc_trans_runtime_check): Same.
(gfc_call_malloc): Same.
(gfc_allocate_with_status): Same.
(gfc_call_free): Same.
(gfc_deallocate_with_status): Same.
(gfc_call_realloc): Same.
(gfc_trans_code): Same.
* trans-decl.c (gfc_init_default_dt): Same.
(gfc_generate_constructors): Same.
* trans-io.c (gfc_trans_io_runtime_check): Same.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same.
(gfc_conv_intrinsic_fdate): Same.
(gfc_conv_intrinsic_ttynam): Same.
(gfc_conv_intrinsic_minmax): Same.
(gfc_conv_intrinsic_minmax_char): Same.
(gfc_conv_intrinsic_anyall): Same.
(gfc_conv_intrinsic_count): Same.
(gfc_conv_intrinsic_arith): Same.
(gfc_conv_intrinsic_minmaxloc): Same.
(gfc_conv_intrinsic_minmaxval): Same.
(gfc_conv_intrinsic_rrspacing): Same.
(gfc_conv_intrinsic_array_transfer): Same.
(gfc_conv_intrinsic_trim): Same.
(gfc_conv_intrinsic_repeat): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148442 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
29 files changed, 316 insertions, 221 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c7801d77376..62b77f61e49 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,45 @@ +2009-06-12 Aldy Hernandez <aldyh@redhat.com> + + * gcc.dg/old-style-prom-3.c: Add column info. + * gcc.dg/overflow-warn-1.c + * gcc.dg/gomp/pr27415.c + * gcc.dg/gomp/for-1.c: Same. + * gcc.dg/enum-compat-1.c: Same. + * gcc.dg/c99-tag-3.c: Same. + * gcc.dg/Wredundant-decls-2.c: Same. + * gcc.dg/func-ptr-conv-1.c: Same. + * gcc.dg/asm-wide-1.c: Same. + * gcc.dg/nofixed-point-2.c: Same. + * gcc.dg/cpp/line3.c: Same. + * gcc.dg/array-10.c: Same. + * gcc.dg/c99-vla-jump-1.c: Same. + * gcc.dg/pr20368-1.c: Same. + * gcc.dg/Wshadow-3.c: Same. + * gcc.dg/c90-const-expr-8.c: Same. + * gcc.dg/label-decl-2.c: Same. + * gcc.dg/dremf-type-compat-2.c: Same. + * gcc.dg/c90-const-expr-5.c: Same. + * gcc.dg/builtins-30.c: Same. + * gcc.dg/Warray-bounds.c: Same. + * gcc.dg/Wcxx-compat-2.c: Same. + * gcc.dg/tree-ssa/col-1.c: Same. + * gcc.dg/old-style-prom-2.c: Same. + * gcc.dg/cast-function-1.c: Same. + * gcc.dg/pr15698-1.c: Same. + * gcc.dg/dremf-type-compat-3.c: Same. + * gcc.dg/vla-8.c: Same. + * gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct + line. + * gcc.dg/label-decl-2.c: Move label diagnostic to correct line. + * gcc.dg/old-style-prom-3.c: Check for error on the correct line. + * gcc.dg/enum-compat-1.c: Same. + * gcc.dg/dremf-type-compat-2.c: Same. + * gcc.dg/old-style-prom-2.c: Same. + * gcc.dg/pr15698-1.c: Same. + * gcc.dg/pr20368-1.c: Same. + * gcc.dg/dremf-type-compat-3.c: Same. + * gcc.dg/builtins-30.c: Same. Test for columns. + 2009-06-12 Janus Weil <janus@gcc.gnu.org> PR fortran/40176 diff --git a/gcc/testsuite/gcc.dg/Warray-bounds.c b/gcc/testsuite/gcc.dg/Warray-bounds.c index ac384e6bb2f..44120392c73 100644 --- a/gcc/testsuite/gcc.dg/Warray-bounds.c +++ b/gcc/testsuite/gcc.dg/Warray-bounds.c @@ -18,40 +18,40 @@ int* f(void) { int c[10]; } c; - a[-1] = 0; /* { dg-warning "array subscript" } */ + a[-1] = 0; /* { dg-warning "6:array subscript" } */ a[ 0] = 0; a[ 1] = 0; a[ 9] = 0; - a[10] = 0; /* { dg-warning "array subscript" } */ - a[11] = 0; /* { dg-warning "array subscript" } */ - a[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */ + a[10] = 0; /* { dg-warning "6:array subscript" } */ + a[11] = 0; /* { dg-warning "6:array subscript" } */ + a[2 * n() - 11] = 1; /* { dg-warning "6:array subscript" } */ a[2 * n() - 10] = 1; a[2 * n() - 1] = 1; - a[2 * n() - 0] = 1; /* { dg-warning "array subscript" } */ + a[2 * n() - 0] = 1; /* { dg-warning "6:array subscript" } */ - b[-1] = 0; /* { dg-warning "array subscript" } */ + b[-1] = 0; /* { dg-warning "6:array subscript" } */ b[ 0] = 0; b[ 1] = 0; b[ 9] = 0; - b[10] = 0; /* { dg-warning "array subscript" } */ - b[11] = 0; /* { dg-warning "array subscript" } */ - b[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */ + b[10] = 0; /* { dg-warning "6:array subscript" } */ + b[11] = 0; /* { dg-warning "6:array subscript" } */ + b[2 * n() - 11] = 1; /* { dg-warning "6:array subscript" } */ b[2 * n() - 10] = 1; b[2 * n() - 1] = 1; b[2 * n() - 0] = 1; /* { dg-warning "array subscript" } */ - c.c[-1] = 0; /* { dg-warning "array subscript" } */ + c.c[-1] = 0; /* { dg-warning "8:array subscript" } */ c.c[ 0] = 0; c.c[ 1] = 0; c.c[ 9] = 0; - c.c[10] = 0; /* { dg-warning "array subscript" } */ - c.c[11] = 0; /* { dg-warning "array subscript" } */ - c.c[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */ + c.c[10] = 0; /* { dg-warning "8:array subscript" } */ + c.c[11] = 0; /* { dg-warning "8:array subscript" } */ + c.c[2 * n() - 11] = 1; /* { dg-warning "8:array subscript" } */ c.c[2 * n() - 10] = 1; c.c[2 * n() - 1] = 1; - c.c[2 * n() - 0] = 1; /* { dg-warning "array subscript" } */ + c.c[2 * n() - 0] = 1; /* { dg-warning "8:array subscript" } */ g(&a[8]); g(&a[9]); @@ -86,7 +86,7 @@ int* f(void) { c.c[-1] = 0; for (i = 20; i < 30; ++i) - a[i] = 1; /* { dg-warning "array subscript" } */ + a[i] = 1; /* { dg-warning "15:array subscript" } */ return a; } diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c index a091c6dd8b5..14edc1a4215 100644 --- a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c +++ b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c @@ -1,36 +1,36 @@ /* { dg-options "-Wc++-compat" } */ _Bool foo; /* This is okay. */ -int bool; /* { dg-warning "keyword" } */ -int catch; /* { dg-warning "keyword" } */ -int char16_t; /* { dg-warning "keyword" } */ -int char32_t; /* { dg-warning "keyword" } */ -int class; /* { dg-warning "keyword" } */ -int const_cast; /* { dg-warning "keyword" } */ -int decltype; /* { dg-warning "keyword" } */ -int delete; /* { dg-warning "keyword" } */ -int dynamic_cast; /* { dg-warning "keyword" } */ -int explicit; /* { dg-warning "keyword" } */ -int export; /* { dg-warning "keyword" } */ -int false; /* { dg-warning "keyword" } */ -int friend; /* { dg-warning "keyword" } */ -int mutable; /* { dg-warning "keyword" } */ -int namespace; /* { dg-warning "keyword" } */ -int new; /* { dg-warning "keyword" } */ -int operator; /* { dg-warning "keyword" } */ -int private; /* { dg-warning "keyword" } */ -int protected; /* { dg-warning "keyword" } */ -int public; /* { dg-warning "keyword" } */ -int reinterpret_cast; /* { dg-warning "keyword" } */ -int static_assert; /* { dg-warning "keyword" } */ -int static_cast; /* { dg-warning "keyword" } */ -int template; /* { dg-warning "keyword" } */ -int this; /* { dg-warning "keyword" } */ -int throw; /* { dg-warning "keyword" } */ -int true; /* { dg-warning "keyword" } */ -int try; /* { dg-warning "keyword" } */ -int typename; /* { dg-warning "keyword" } */ -int typeid; /* { dg-warning "keyword" } */ -int using; /* { dg-warning "keyword" } */ -int virtual; /* { dg-warning "keyword" } */ +int bool; /* { dg-warning "5:keyword" } */ +int catch; /* { dg-warning "5:keyword" } */ +int char16_t; /* { dg-warning "5:keyword" } */ +int char32_t; /* { dg-warning "5:keyword" } */ +int class; /* { dg-warning "5:keyword" } */ +int const_cast; /* { dg-warning "5:keyword" } */ +int decltype; /* { dg-warning "5:keyword" } */ +int delete; /* { dg-warning "5:keyword" } */ +int dynamic_cast; /* { dg-warning "5:keyword" } */ +int explicit; /* { dg-warning "5:keyword" } */ +int export; /* { dg-warning "5:keyword" } */ +int false; /* { dg-warning "5:keyword" } */ +int friend; /* { dg-warning "5:keyword" } */ +int mutable; /* { dg-warning "5:keyword" } */ +int namespace; /* { dg-warning "5:keyword" } */ +int new; /* { dg-warning "5:keyword" } */ +int operator; /* { dg-warning "5:keyword" } */ +int private; /* { dg-warning "5:keyword" } */ +int protected; /* { dg-warning "5:keyword" } */ +int public; /* { dg-warning "5:keyword" } */ +int reinterpret_cast; /* { dg-warning "5:keyword" } */ +int static_assert; /* { dg-warning "5:keyword" } */ +int static_cast; /* { dg-warning "5:keyword" } */ +int template; /* { dg-warning "5:keyword" } */ +int this; /* { dg-warning "5:keyword" } */ +int throw; /* { dg-warning "5:keyword" } */ +int true; /* { dg-warning "5:keyword" } */ +int try; /* { dg-warning "5:keyword" } */ +int typename; /* { dg-warning "5:keyword" } */ +int typeid; /* { dg-warning "5:keyword" } */ +int using; /* { dg-warning "5:keyword" } */ +int virtual; /* { dg-warning "5:keyword" } */ int wchar_t; diff --git a/gcc/testsuite/gcc.dg/Wredundant-decls-2.c b/gcc/testsuite/gcc.dg/Wredundant-decls-2.c index 89f57b427c6..27c8e5d9f7d 100644 --- a/gcc/testsuite/gcc.dg/Wredundant-decls-2.c +++ b/gcc/testsuite/gcc.dg/Wredundant-decls-2.c @@ -2,22 +2,22 @@ /* { dg-do compile } */ /* { dg-options "-Wredundant-decls" } */ -int j = 5; /* { dg-message "note: previous" } */ -int j; /* { dg-warning "redundant" } */ +int j = 5; /* { dg-message "5:note: previous" } */ +int j; /* { dg-warning "5:redundant" } */ static int k; -static int k = 5; /* { dg-message "note: previous" } */ -static int k; /* { dg-warning "redundant" } */ +static int k = 5; /* { dg-message "12:note: previous" } */ +static int k; /* { dg-warning "12:redundant" } */ -static int l = 5; /* { dg-message "note: previous" } */ -static int l; /* { dg-warning "redundant" } */ +static int l = 5; /* { dg-message "12:note: previous" } */ +static int l; /* { dg-warning "12:redundant" } */ -static int m; /* { dg-message "note: previous" } */ -static int m; /* { dg-warning "redundant" } */ +static int m; /* { dg-message "12:note: previous" } */ +static int m; /* { dg-warning "12:redundant" } */ static int m = 5; -int n; /* { dg-message "note: previous" } */ -int n; /* { dg-warning "redundant" } */ +int n; /* { dg-message "5:note: previous" } */ +int n; /* { dg-warning "5:redundant" } */ int n = 5; static int o; diff --git a/gcc/testsuite/gcc.dg/Wshadow-3.c b/gcc/testsuite/gcc.dg/Wshadow-3.c index a7f06a26f96..b6d78b1d38b 100644 --- a/gcc/testsuite/gcc.dg/Wshadow-3.c +++ b/gcc/testsuite/gcc.dg/Wshadow-3.c @@ -1,21 +1,61 @@ -/* Test warnings for shadowing in function prototype scope: generally - useless but of use if the parameter is used within the scope. Bug - 529. */ -/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* PR middle-end/36902 Array bound warning with dead code after optimization */ /* { dg-do compile } */ -/* { dg-options "-std=gnu89 -Wshadow" } */ - -int v; /* { dg-warning "shadowed declaration" } */ -int f1(int v); -int f2(int v, int x[v]); /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f3(int v, int y[sizeof(v)]); /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f4(int v) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f5(int v, int x[v]) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f6(int x) { return 0; } -int f7(v) int v; { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f8(v, w) int v; int w[v]; { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f9(x) int x; { return 0; } -int f10(v) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f11(int a, int b(int a)); -int f12(int a, int b(int a, int x[a])); /* { dg-warning "declaration of 'a' shadows a parameter" } */ -/* { dg-warning "shadowed declaration" "outer parm" { target *-*-* } 20 } */ +/* { dg-options "-O2 -Warray-bounds -Wall -Wextra" } */ +typedef unsigned char __u8; +typedef unsigned short __u16; + +static inline unsigned char * +foo(unsigned char * to, const unsigned char * from, int n) +{ + switch ( n ) + { + case 3: + *to = *from; + break; + case 5: + to[4] = from [4]; + break; + } + return to; +} + +struct { + int size_of_select; + unsigned char pcr_select[4]; +} sel; + +int bar(void) +{ + static unsigned char buf[64]; + + sel.size_of_select = 3; + foo(buf, sel.pcr_select, sel.size_of_select); + + return 1; +} + + +static inline unsigned char * +foo2(unsigned char * to, const unsigned char * from, int n) +{ + switch ( n ) + { + case 3: + *to = *from; + break; + case 5: + to[63] = from [111]; /* { dg-warning "array subscript is above array bounds" } */ + break; + } + return to; +} + +int baz(void) +{ + static unsigned char buf[64]; + + sel.size_of_select = 5; + foo2(buf, sel.pcr_select, sel.size_of_select); + + return 1; +} diff --git a/gcc/testsuite/gcc.dg/array-10.c b/gcc/testsuite/gcc.dg/array-10.c index aab1538d5e1..3b4d512ba5a 100644 --- a/gcc/testsuite/gcc.dg/array-10.c +++ b/gcc/testsuite/gcc.dg/array-10.c @@ -6,28 +6,28 @@ int a; -int b0[a]; /* { dg-error "at file scope" } */ -int (*b1)[a]; /* { dg-error "at file scope" } */ +int b0[a]; /* { dg-error "5:at file scope" } */ +int (*b1)[a]; /* { dg-error "7:at file scope" } */ int (*b2())[a]; /* { dg-error "at file scope" } */ -struct b3 { int x[a]; }; /* { dg-error "at file scope" } */ -struct b4 { int (*x)[a]; }; /* { dg-error "at file scope" } */ +struct b3 { int x[a]; }; /* { dg-error "17:at file scope" } */ +struct b4 { int (*x)[a]; }; /* { dg-error "19:at file scope" } */ typeof (int [a]) b5; /* { dg-error "at file scope|outside of any function" } */ -int c0[(__SIZE_TYPE__)&a]; /* { dg-error "at file scope" } */ -int (*c1)[(__SIZE_TYPE__)&a]; /* { dg-error "at file scope" } */ -int (*c2())[(__SIZE_TYPE__)&a]; /* { dg-error "at file scope" } */ -struct c3 { int x[(__SIZE_TYPE__)&a]; }; /* { dg-error "at file scope" } */ -struct c4 { int (*x)[(__SIZE_TYPE__)&a]; }; /* { dg-error "at file scope" } */ -typeof (int [(__SIZE_TYPE__)&a]) c5; /* { dg-error "at file scope" } */ +int c0[(__SIZE_TYPE__)&a]; /* { dg-error "5:at file scope" } */ +int (*c1)[(__SIZE_TYPE__)&a]; /* { dg-error "7:at file scope" } */ +int (*c2())[(__SIZE_TYPE__)&a]; /* { dg-error "7:at file scope" } */ +struct c3 { int x[(__SIZE_TYPE__)&a]; }; /* { dg-error "17:at file scope" } */ +struct c4 { int (*x)[(__SIZE_TYPE__)&a]; }; /* { dg-error "19:at file scope" } */ +typeof (int [(__SIZE_TYPE__)&a]) c5; /* { dg-error "34:at file scope" } */ -int d0[1/0]; /* { dg-error "at file scope" } */ -/* { dg-warning "division by zero" "" { target *-*-* } 23 } */ -int (*d1)[1/0]; /* { dg-error "at file scope" } */ -/* { dg-warning "division by zero" "" { target *-*-* } 25 } */ -int (*d2())[1/0]; /* { dg-error "at file scope" } */ -/* { dg-warning "division by zero" "" { target *-*-* } 27 } */ -struct d3 { int x[1/0]; }; /* { dg-error "at file scope" } */ -/* { dg-warning "division by zero" "" { target *-*-* } 29 } */ -struct d4 { int (*x)[1/0]; }; /* { dg-error "at file scope" } */ -/* { dg-warning "division by zero" "" { target *-*-* } 31 } */ -typeof (int [1/0]) d5; /* { dg-error "at file scope" } */ +int d0[1/0]; /* { dg-error "5:at file scope" } */ +/* { dg-warning "9:division by zero" "" { target *-*-* } 23 } */ +int (*d1)[1/0]; /* { dg-error "7:at file scope" } */ +/* { dg-warning "12:division by zero" "" { target *-*-* } 25 } */ +int (*d2())[1/0]; /* { dg-error "7:at file scope" } */ +/* { dg-warning "14:division by zero" "" { target *-*-* } 27 } */ +struct d3 { int x[1/0]; }; /* { dg-error "17:at file scope" } */ +/* { dg-warning "20:division by zero" "" { target *-*-* } 29 } */ +struct d4 { int (*x)[1/0]; }; /* { dg-error "19:at file scope" } */ +/* { dg-warning "23:division by zero" "" { target *-*-* } 31 } */ +typeof (int [1/0]) d5; /* { dg-error "20:at file scope" } */ diff --git a/gcc/testsuite/gcc.dg/asm-wide-1.c b/gcc/testsuite/gcc.dg/asm-wide-1.c index a42271fd4b1..c14b19d3479 100644 --- a/gcc/testsuite/gcc.dg/asm-wide-1.c +++ b/gcc/testsuite/gcc.dg/asm-wide-1.c @@ -3,27 +3,27 @@ /* { dg-do compile } */ /* { dg-options "" } */ -int foo asm (L"bar"); /* { dg-error "wide string literal in 'asm'" } */ +int foo asm (L"bar"); /* { dg-error "14:wide string literal in 'asm'" } */ -asm (L"foo"); /* { dg-error "wide string literal in 'asm'" } */ +asm (L"foo"); /* { dg-error "6:wide string literal in 'asm'" } */ void f (void) { int x = 1; - asm (L"foo"); /* { dg-error "wide string literal in 'asm'" } */ + asm (L"foo"); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : - L"=g" (x)); /* { dg-error "wide string literal in 'asm'" } */ + L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : [x] - L"=g" (x)); /* { dg-error "wide string literal in 'asm'" } */ + L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : [x] "=g" (x), - L"=g" (x)); /* { dg-error "wide string literal in 'asm'" } */ + L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : : - L"g" (x)); /* { dg-error "wide string literal in 'asm'" } */ + L"g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : : : - L"memory"); /* { dg-error "wide string literal in 'asm'" } */ + L"memory"); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : : : "memory", - L"memory"); /* { dg-error "wide string literal in 'asm'" } */ + L"memory"); /* { dg-error "8:wide string literal in 'asm'" } */ } /* Extra errors from the substitution of "" for wide strings: */ diff --git a/gcc/testsuite/gcc.dg/builtins-30.c b/gcc/testsuite/gcc.dg/builtins-30.c index 65a78fefe1d..37e5dba2db6 100644 --- a/gcc/testsuite/gcc.dg/builtins-30.c +++ b/gcc/testsuite/gcc.dg/builtins-30.c @@ -1,29 +1,27 @@ /* { dg-do compile } */ -/* { dg-options "-Wall -Wshadow" } */ +/* { dg-options "-Wall -Wshadow -fshow-column" } */ extern double strtod (const char *, char **); #define UNUSED __attribute__ ((unused)) /* A built-in function may be overridden by an old-style definition specifying too few arguments... */ -double cos () /* { dg-warning "shadows a built-in" } */ +double cos () /* { dg-warning "shadows a built-in|number of arguments" } */ { - /* { dg-warning "number of arguments doesn't match built-in prototype" "built-in" { target *-*-* } 10 } */ return strtod ("nan", 0); } /* the right number, but the wrong type, arguments... */ -double sin (foo) /* { dg-warning "shadows a built-in" } */ - int foo UNUSED; -{ /* { dg-warning "argument 'foo' doesn't match built-in prototype" } */ +double sin (foo) /* { dg-warning "8:shadows a built-in" } */ + int foo UNUSED; /* { dg-warning "10:argument 'foo' doesn't match built-in prototype" } */ +{ return strtod ("nan", 0); } /* or too many arguments. */ -long double cosl (foo, bar) /* { dg-warning "shadows a built-in" } */ - const char *foo UNUSED; +long double cosl (foo, bar) /* { dg-warning "shadows a built-in|number of arguments" } */ + const char *foo UNUSED; /* { dg-warning "18:argument 'foo' doesn't match" } */ int bar UNUSED; -{ /* { dg-warning "number of arguments doesn't match built-in prototype" } */ - /* { dg-warning "argument 'foo' doesn't match built-in prototype" "foo" { target *-*-* } 26 } */ +{ return strtod ("nan", 0); } diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-5.c b/gcc/testsuite/gcc.dg/c90-const-expr-5.c index 0a5af8124cd..9f5cdef8399 100644 --- a/gcc/testsuite/gcc.dg/c90-const-expr-5.c +++ b/gcc/testsuite/gcc.dg/c90-const-expr-5.c @@ -2,7 +2,7 @@ qualified void. */ /* Origin: Joseph Myers <joseph@codesourcery.com> */ /* { dg-do compile } */ -/* { dg-options "-std=iso9899:1990 -pedantic-errors -fshow-column" } */ +/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */ typedef void V; int *p; @@ -15,14 +15,14 @@ f (void) { /* (V *)0 is a null pointer constant, so the assignment should be diagnosed. */ - q = (j ? p : (V *)0); /* { dg-error "3:assignment from incompatible pointer type" } */ - q = (j ? p : (void *)0); /* { dg-error "3:assignment from incompatible pointer type" } */ + q = (j ? p : (V *)0); /* { dg-error "5:assignment from incompatible pointer type" } */ + q = (j ? p : (void *)0); /* { dg-error "5:assignment from incompatible pointer type" } */ /* And this conversion should be valid. */ (void (*)(void))(V *)0; (void (*)(void))(void *)0; /* Pointers to qualified void are not valid null pointer constants. */ - fp = (const void *)0; /* { dg-error "3:ISO C forbids assignment between function pointer and 'void \\*'" } */ + fp = (const void *)0; /* { dg-error "6:ISO C forbids assignment between function pointer and 'void \\*'" } */ fp = (void *)0; fp = (V *)0; fp = 0; diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-8.c b/gcc/testsuite/gcc.dg/c90-const-expr-8.c index 966044c4eff..b00bb9718f8 100644 --- a/gcc/testsuite/gcc.dg/c90-const-expr-8.c +++ b/gcc/testsuite/gcc.dg/c90-const-expr-8.c @@ -9,19 +9,19 @@ #include <limits.h> enum e { - E0 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 12 } */ - E1 = 0 * (INT_MIN / -1), /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 14 } */ - E2 = 0 * (INT_MAX * INT_MAX), /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 16 } */ - E3 = 0 * (INT_MIN - 1), /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 18 } */ - E4 = 0 * (unsigned)(INT_MIN - 1), /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 20 } */ - E5 = 0 * -INT_MIN, /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 22 } */ - E6 = 0 * !-INT_MIN, /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "not an integer constant" "constant" { target *-*-* } 24 } */ + E0 = 0 * (INT_MAX + 1), /* { dg-warning "21:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 12 } */ + E1 = 0 * (INT_MIN / -1), /* { dg-warning "21:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 14 } */ + E2 = 0 * (INT_MAX * INT_MAX), /* { dg-warning "21:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 16 } */ + E3 = 0 * (INT_MIN - 1), /* { dg-warning "21:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 18 } */ + E4 = 0 * (unsigned)(INT_MIN - 1), /* { dg-warning "31:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 20 } */ + E5 = 0 * -INT_MIN, /* { dg-warning "12:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 22 } */ + E6 = 0 * !-INT_MIN, /* { dg-warning "13:integer overflow in expression" } */ + /* { dg-error "3:not an integer constant" "constant" { target *-*-* } 24 } */ E7 = INT_MIN % -1 /* Not an overflow. */ }; diff --git a/gcc/testsuite/gcc.dg/c99-tag-3.c b/gcc/testsuite/gcc.dg/c99-tag-3.c index 7406e7d64c7..a492037b07a 100644 --- a/gcc/testsuite/gcc.dg/c99-tag-3.c +++ b/gcc/testsuite/gcc.dg/c99-tag-3.c @@ -13,10 +13,10 @@ void f (void) { struct s0; } /* A declaration with a qualifier or storage class specifier declares the tag if no other declaration of it is visible. */ -const union u0; /* { dg-warning "useless type qualifier in empty declaration" } */ +const union u0; /* { dg-warning "13:useless type qualifier in empty declaration" } */ union u0 { long b; }; -extern struct s1; /* { dg-warning "useless storage class specifier in empty declaration" } */ +extern struct s1; /* { dg-warning "15:useless storage class specifier in empty declaration" } */ /* But if a declaration of the tag is visible, whether at the same scope or an outer scope, the declaration specifies the same type as @@ -25,13 +25,13 @@ extern struct s1; /* { dg-warning "useless storage class specifier in empty decl the members of an enumeration, it is a constraint violation. */ struct s2 { char x; }; -const struct s2; /* { dg-error "empty declaration with type qualifier does not redeclare tag" } */ +const struct s2; /* { dg-error "14:empty declaration with type qualifier does not redeclare tag" } */ union u1; -extern union u1; /* { dg-error "empty declaration with storage class specifier does not redeclare tag" } */ +extern union u1; /* { dg-error "14:empty declaration with storage class specifier does not redeclare tag" } */ union u2 { long b; }; -void g(void) { const union u2; } /* { dg-error "empty declaration with type qualifier does not redeclare tag" } */ +void g(void) { const union u2; } /* { dg-error "28:empty declaration with type qualifier does not redeclare tag" } */ /* And it does not redeclare the tag either if the outer tag is the wrong kind of tag. This also yields an error for the reference to @@ -39,21 +39,21 @@ void g(void) { const union u2; } /* { dg-error "empty declaration with type qual declaration. */ union u3 { float v; }; -void h(void) { const struct u3; } /* { dg-error "'u3' defined as wrong kind of tag" } */ -/* { dg-error "empty declaration with type qualifier does not redeclare tag" "wrong tag empty" { target *-*-* } 42 } */ +void h(void) { const struct u3; } /* { dg-error "29:'u3' defined as wrong kind of tag" } */ +/* { dg-error "29:empty declaration with type qualifier does not redeclare tag" "wrong tag empty" { target *-*-* } 42 } */ /* However, such useless specifiers are OK if the contents of the tag are being defined, or shadowed in an inner scope with the contents included in the shadowing. */ struct s3; -const struct s3 { int a; }; /* { dg-warning "useless type qualifier in empty declaration" } */ +const struct s3 { int a; }; /* { dg-warning "14:useless type qualifier in empty declaration" } */ union u4; -extern union u4 { int z; }; /* { dg-warning "useless storage class specifier in empty declaration" } */ +extern union u4 { int z; }; /* { dg-warning "14:useless storage class specifier in empty declaration" } */ enum e0 { E0 }; -void i(void) { const enum e0 { E1 }; } /* { dg-warning "useless type qualifier in empty declaration" } */ +void i(void) { const enum e0 { E1 }; } /* { dg-warning "32:useless type qualifier in empty declaration" } */ union u5 { int p; }; -void j(void) { extern struct u5 { int q; }; } /* { dg-warning "useless storage class specifier in empty declaration" } */ +void j(void) { extern struct u5 { int q; }; } /* { dg-warning "30:useless storage class specifier in empty declaration" } */ diff --git a/gcc/testsuite/gcc.dg/c99-vla-jump-1.c b/gcc/testsuite/gcc.dg/c99-vla-jump-1.c index 4e984d2b81b..3cfa384d1ca 100644 --- a/gcc/testsuite/gcc.dg/c99-vla-jump-1.c +++ b/gcc/testsuite/gcc.dg/c99-vla-jump-1.c @@ -15,11 +15,11 @@ /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ void fa0 (int n) { goto a; a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } -void fa1 (int n) { goto a; { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */ -void fa2 (int n) { goto a; { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */ -void fa3 (int n) { goto a; { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */ -void fa4 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */ -void fa5 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */ +void fa1 (int n) { goto a; { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "41:jump into scope of identifier with variably modified type" } */ +void fa2 (int n) { goto a; { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "53:jump into scope of identifier with variably modified type" } */ +void fa3 (int n) { goto a; { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "57:jump into scope of identifier with variably modified type" } */ +void fa4 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "69:jump into scope of identifier with variably modified type" } */ +void fa5 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "73:jump into scope of identifier with variably modified type" } */ void fa6 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */ void fa7 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } void fa8 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */ diff --git a/gcc/testsuite/gcc.dg/cast-function-1.c b/gcc/testsuite/gcc.dg/cast-function-1.c index 8ed7d5da41c..781d0e22191 100644 --- a/gcc/testsuite/gcc.dg/cast-function-1.c +++ b/gcc/testsuite/gcc.dg/cast-function-1.c @@ -22,14 +22,14 @@ void bar(void) int i; str_t s; - d = ((double (*) (int)) foo1) (i); /* { dg-warning "non-compatible|abort" } */ - i = ((int (*) (double)) foo1) (d); /* { dg-warning "non-compatible|abort" } */ - s = ((str_t (*) (int)) foo1) (i); /* { dg-warning "non-compatible|abort" } */ + d = ((double (*) (int)) foo1) (i); /* { dg-warning "33:non-compatible|abort" } */ + i = ((int (*) (double)) foo1) (d); /* { dg-warning "33:non-compatible|abort" } */ + s = ((str_t (*) (int)) foo1) (i); /* { dg-warning "32:non-compatible|abort" } */ ((void (*) (int)) foo1) (d); /* { dg-warning "non-compatible|abort" } */ i = ((int (*) (int)) foo1) (i); /* { dg-bogus "non-compatible|abort" } */ (void) foo1 (i); /* { dg-bogus "non-compatible|abort" } */ - d = ((double (*) (int)) foo2) (i); /* { dg-warning "non-compatible|abort" } */ + d = ((double (*) (int)) foo2) (i); /* { dg-warning "33:non-compatible|abort" } */ i = ((int (*) (double)) foo2) (d); /* { dg-bogus "non-compatible|abort" } */ s = ((str_t (*) (int)) foo2) (i); /* { dg-warning "non-compatible|abort" } */ ((void (*) (int)) foo2) (d); /* { dg-warning "non-compatible|abort" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/line3.c b/gcc/testsuite/gcc.dg/cpp/line3.c index dc5bf818da9..7a1061478d4 100644 --- a/gcc/testsuite/gcc.dg/cpp/line3.c +++ b/gcc/testsuite/gcc.dg/cpp/line3.c @@ -14,15 +14,15 @@ main(void) char *A; A = "text"; /* { dg-warning "discards qualifiers" "case zero" } */ - A = one("text" + A = one("text" /* { dg-warning "discards qualifiers" "case one" } */ "text") - ; /* { dg-warning "discards qualifiers" "case one" } */ - A = two("text" + ; + A = two("text" /* { dg-warning "discards qualifiers" "case two" } */ "text") - ; /* { dg-warning "discards qualifiers" "case two" } */ - A = four("text" + ; + A = four("text" /* { dg-warning "discards qualifiers" "case four" } */ "text") - ; /* { dg-warning "discards qualifiers" "case four" } */ + ; return 0; } diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-2.c b/gcc/testsuite/gcc.dg/dremf-type-compat-2.c index 61f0ba84fe3..980ead187e7 100644 --- a/gcc/testsuite/gcc.dg/dremf-type-compat-2.c +++ b/gcc/testsuite/gcc.dg/dremf-type-compat-2.c @@ -11,8 +11,8 @@ float dremf (float, float); /* { dg-warning "prototype declaration" } */ float dremf (x, y) - float x; - float y; -{ /* { dg-warning "promoted argument '.' doesn't match prototype" } */ + float x; /* { dg-warning "promoted argument 'x' doesn't match prototype" } */ + float y; /* { dg-warning "promoted argument 'y' doesn't match prototype" } */ +{ return x + y; } diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-3.c b/gcc/testsuite/gcc.dg/dremf-type-compat-3.c index 437e26f65ba..3934a64e19f 100644 --- a/gcc/testsuite/gcc.dg/dremf-type-compat-3.c +++ b/gcc/testsuite/gcc.dg/dremf-type-compat-3.c @@ -11,8 +11,8 @@ float dremf (float, float); /* { dg-error "prototype declaration" } */ float dremf (x, y) - float x; - float y; -{ /* { dg-error "promoted argument '.' doesn't match prototype" } */ + float x; /* { dg-error "promoted argument 'x' doesn't match prototype" } */ + float y; /* { dg-error "promoted argument 'y' doesn't match prototype" } */ +{ return x + y; } diff --git a/gcc/testsuite/gcc.dg/enum-compat-1.c b/gcc/testsuite/gcc.dg/enum-compat-1.c index 18d1f7fe715..5fb150cee79 100644 --- a/gcc/testsuite/gcc.dg/enum-compat-1.c +++ b/gcc/testsuite/gcc.dg/enum-compat-1.c @@ -12,8 +12,8 @@ enum e2 {c, d}; void f(enum e1); /* { dg-error "prototype" "error at decl" } */ void f(x) - enum e2 x; -{ /* { dg-error "doesn't match prototype" "error at defn" } */ + enum e2 x; /* { dg-error "doesn't match prototype" } */ +{ return; } diff --git a/gcc/testsuite/gcc.dg/func-ptr-conv-1.c b/gcc/testsuite/gcc.dg/func-ptr-conv-1.c index 4e42e5fe117..c331fbc88fc 100644 --- a/gcc/testsuite/gcc.dg/func-ptr-conv-1.c +++ b/gcc/testsuite/gcc.dg/func-ptr-conv-1.c @@ -9,15 +9,15 @@ void f(void); -void *v1 = f; /* { dg-warning "pointer" "bad conversion" } */ -void *v2 = &f; /* { dg-warning "pointer" "bad conversion" } */ -void *v3 = (void *)f; /* { dg-warning "pointer" "bad conversion" } */ -void *v4 = (void *)&f; /* { dg-warning "pointer" "bad conversion" } */ +void *v1 = f; /* { dg-warning "12:pointer" "bad conversion" } */ +void *v2 = &f; /* { dg-warning "12:pointer" "bad conversion" } */ +void *v3 = (void *)f; /* { dg-warning "12:pointer" "bad conversion" } */ +void *v4 = (void *)&f; /* { dg-warning "12:pointer" "bad conversion" } */ void *v5; -char *c1 = f; /* { dg-warning "pointer" "bad conversion" } */ -char *c2 = &f; /* { dg-warning "pointer" "bad conversion" } */ -char *c3 = (char *)f; /* { dg-warning "pointer" "bad conversion" } */ -char *c4 = (char *)&f; /* { dg-warning "pointer" "bad conversion" } */ +char *c1 = f; /* { dg-warning "12:pointer" "bad conversion" } */ +char *c2 = &f; /* { dg-warning "12:pointer" "bad conversion" } */ +char *c3 = (char *)f; /* { dg-warning "12:pointer" "bad conversion" } */ +char *c4 = (char *)&f; /* { dg-warning "12:pointer" "bad conversion" } */ char *c5; void (*fp)(void); int a; @@ -25,20 +25,20 @@ int a; void g(void) { - v5 = f; /* { dg-warning "pointer" "bad conversion" } */ - v5 = &f; /* { dg-warning "pointer" "bad conversion" } */ - v5 = (void *)f; /* { dg-warning "pointer" "bad conversion" } */ - v5 = (void *)&f; /* { dg-warning "pointer" "bad conversion" } */ - c5 = f; /* { dg-warning "pointer" "bad conversion" } */ - c5 = &f; /* { dg-warning "pointer" "bad conversion" } */ - c5 = (char *)f; /* { dg-warning "pointer" "bad conversion" } */ - c5 = (char *)&f; /* { dg-warning "pointer" "bad conversion" } */ - fp = v5; /* { dg-warning "pointer" "bad conversion" } */ - fp = c5; /* { dg-warning "pointer" "bad conversion" } */ - fp = (void (*)(void))v5; /* { dg-warning "pointer" "bad conversion" } */ - fp = (void (*)(void))c5; /* { dg-warning "pointer" "bad conversion" } */ - (a ? f : v3); /* { dg-warning "pointer" "bad conversion" } */ - (a ? v2 : fp); /* { dg-warning "pointer" "bad conversion" } */ + v5 = f; /* { dg-warning "6:pointer" "bad conversion" } */ + v5 = &f; /* { dg-warning "6:pointer" "bad conversion" } */ + v5 = (void *)f; /* { dg-warning "8:pointer" "bad conversion" } */ + v5 = (void *)&f; /* { dg-warning "8:pointer" "bad conversion" } */ + c5 = f; /* { dg-warning "6:pointer" "bad conversion" } */ + c5 = &f; /* { dg-warning "6:pointer" "bad conversion" } */ + c5 = (char *)f; /* { dg-warning "8:pointer" "bad conversion" } */ + c5 = (char *)&f; /* { dg-warning "8:pointer" "bad conversion" } */ + fp = v5; /* { dg-warning "6:pointer" "bad conversion" } */ + fp = c5; /* { dg-warning "6:pointer" "bad conversion" } */ + fp = (void (*)(void))v5; /* { dg-warning "8:pointer" "bad conversion" } */ + fp = (void (*)(void))c5; /* { dg-warning "8:pointer" "bad conversion" } */ + (a ? f : v3); /* { dg-warning "6:pointer" "bad conversion" } */ + (a ? v2 : fp); /* { dg-warning "6:pointer" "bad conversion" } */ /* The following are OK. */ fp = 0; fp = (void *)0; diff --git a/gcc/testsuite/gcc.dg/gomp/for-1.c b/gcc/testsuite/gcc.dg/gomp/for-1.c index 840f9478499..384293e8275 100644 --- a/gcc/testsuite/gcc.dg/gomp/for-1.c +++ b/gcc/testsuite/gcc.dg/gomp/for-1.c @@ -44,6 +44,6 @@ void foo (int j, int k) baz (i); #pragma omp for - for (i = 0; i < 10; i-=3, j+=2) /* { dg-error "23:invalid increment expression" } */ + for (i = 0; i < 10; i-=3, j+=2) /* { dg-error "27:invalid increment expression" } */ baz (i); } diff --git a/gcc/testsuite/gcc.dg/gomp/pr27415.c b/gcc/testsuite/gcc.dg/gomp/pr27415.c index 418eaf678e9..010a6c3e4dd 100644 --- a/gcc/testsuite/gcc.dg/gomp/pr27415.c +++ b/gcc/testsuite/gcc.dg/gomp/pr27415.c @@ -15,8 +15,8 @@ void test2 (void) { int i = 0; -#pragma omp parallel for firstprivate (i) - for (i = 0; i < 10; i++) /* { dg-error "should not be firstprivate" } */ +#pragma omp parallel for firstprivate (i) /* { dg-error "should not be firstprivate" } */ + for (i = 0; i < 10; i++) ; } @@ -34,8 +34,8 @@ void test4 (void) { int i = 0; -#pragma omp parallel for reduction (*:i) - for (i = 0; i < 10; i++) /* { dg-error "should not be reduction" } */ +#pragma omp parallel for reduction (*:i) /* { dg-error "should not be reduction" } */ + for (i = 0; i < 10; i++) ; } diff --git a/gcc/testsuite/gcc.dg/label-decl-2.c b/gcc/testsuite/gcc.dg/label-decl-2.c index 97c453b78b7..6706a706bfe 100644 --- a/gcc/testsuite/gcc.dg/label-decl-2.c +++ b/gcc/testsuite/gcc.dg/label-decl-2.c @@ -8,9 +8,8 @@ typedef int b; void f (void) { - __label__ a, b, c, d; + __label__ a, b, c, d; /* { dg-warning "ISO C forbids label declarations" "label decls" { target *-*-* } 11 } */ __extension__ (void)&&d; /* { dg-error "label 'd' used but not defined" } */ - /* { dg-warning "ISO C forbids label declarations" "label decls" { target *-*-* } 11 } */ goto c; /* { dg-error "label 'c' used but not defined" } */ a: (void)0; b: (void)0; diff --git a/gcc/testsuite/gcc.dg/nofixed-point-2.c b/gcc/testsuite/gcc.dg/nofixed-point-2.c index 97bbf70225c..5820ded922e 100644 --- a/gcc/testsuite/gcc.dg/nofixed-point-2.c +++ b/gcc/testsuite/gcc.dg/nofixed-point-2.c @@ -9,7 +9,7 @@ f1 (void) } __typeof (0r) /* { dg-error "not supported" "reject fixed-point" } */ -b2 (void) +b2 (void) /* { dg-warning "defaults to" } */ { return 0r; /* { dg-error "not supported" "reject fixed-point" } */ } @@ -26,5 +26,4 @@ f4 (void) /* { dg-error "not supported" "reject fixed-point" } */ return 0k; /* { dg-error "not supported" "reject fixed-point" } */ } -/* { dg-warning "defaults to" "" { target *-*-* } 13 } */ /* { dg-error "is used without" "" { target *-*-* } 24 } */ diff --git a/gcc/testsuite/gcc.dg/old-style-prom-2.c b/gcc/testsuite/gcc.dg/old-style-prom-2.c index 0460facef61..e7e690e1417 100644 --- a/gcc/testsuite/gcc.dg/old-style-prom-2.c +++ b/gcc/testsuite/gcc.dg/old-style-prom-2.c @@ -7,8 +7,8 @@ float f (float, float); /* { dg-warning "prototype declaration" } */ float f (x, y) - float x; - float y; -{ /* { dg-warning "promoted argument '.' doesn't match prototype" } */ + float x; /* { dg-warning "promoted argument 'x' doesn't match prototype" } */ + float y; /* { dg-warning "promoted argument 'y' doesn't match prototype" } */ +{ return x + y; } diff --git a/gcc/testsuite/gcc.dg/old-style-prom-3.c b/gcc/testsuite/gcc.dg/old-style-prom-3.c index 931a4a7264b..720367f2e33 100644 --- a/gcc/testsuite/gcc.dg/old-style-prom-3.c +++ b/gcc/testsuite/gcc.dg/old-style-prom-3.c @@ -7,8 +7,8 @@ float f (float, float); /* { dg-error "prototype declaration" } */ float f (x, y) - float x; - float y; -{ /* { dg-error "promoted argument '.' doesn't match prototype" } */ + float x; /* { dg-error "promoted argument 'x' doesn't match prototype" } */ + float y; /* { dg-error "promoted argument 'y' doesn't match prototype" } */ +{ return x + y; } diff --git a/gcc/testsuite/gcc.dg/overflow-warn-1.c b/gcc/testsuite/gcc.dg/overflow-warn-1.c index 0cf08a3e77f..78909df368b 100644 --- a/gcc/testsuite/gcc.dg/overflow-warn-1.c +++ b/gcc/testsuite/gcc.dg/overflow-warn-1.c @@ -12,23 +12,23 @@ enum e { /* Overflow in an unevaluated part of an expression is OK (example in the standard). */ E2 = 2 || 1 / 0, - E3 = 1 / 0, /* { dg-warning "division by zero" } */ - /* { dg-error "enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */ + E3 = 1 / 0, /* { dg-warning "10:division by zero" } */ + /* { dg-error "3:enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */ /* But as in DR#031, the 1/0 in an evaluated subexpression means the whole expression violates the constraints. */ - E4 = 0 * (1 / 0), /* { dg-warning "division by zero" } */ + E4 = 0 * (1 / 0), /* { dg-warning "15:division by zero" } */ /* { dg-error "enumerator value for 'E4' is not an integer constant" "enum error" { target *-*-* } 19 } */ - E5 = INT_MAX + 1, /* { dg-warning "integer overflow in expression" } */ + E5 = INT_MAX + 1, /* { dg-warning "16:integer overflow in expression" } */ /* Again, overflow in evaluated subexpression. */ - E6 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */ + E6 = 0 * (INT_MAX + 1), /* { dg-warning "21:integer overflow in expression" } */ /* A cast does not constitute overflow in conversion. */ E7 = (char) INT_MAX }; struct s { int a; - int : 0 * (1 / 0); /* { dg-warning "division by zero" } */ - /* { dg-error "not an integer constant" "integer constant" { target *-*-* } 30 } */ + int : 0 * (1 / 0); /* { dg-warning "16:division by zero" } */ + /* { dg-error "not an integer constant" "22:integer constant" { target *-*-* } 30 } */ int : 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */ }; @@ -37,11 +37,11 @@ f (void) { /* This expression is not required to be a constant expression, so it should just involve undefined behavior at runtime. */ - int c = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ + int c = INT_MAX + 1; /* { dg-warning "19:integer overflow in expression" } */ } /* But this expression does need to be constant. */ -static int sc = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ +static int sc = INT_MAX + 1; /* { dg-warning "25:integer overflow in expression" } */ /* The first two of these involve overflow, so are not null pointer constants. The third has the overflow in an unevaluated diff --git a/gcc/testsuite/gcc.dg/pr15698-1.c b/gcc/testsuite/gcc.dg/pr15698-1.c index 6bb001aea7f..5a75a10733f 100644 --- a/gcc/testsuite/gcc.dg/pr15698-1.c +++ b/gcc/testsuite/gcc.dg/pr15698-1.c @@ -17,7 +17,7 @@ int foobar () } char *rindex(a, b) - register char *a, b; -{ /* { dg-warning "argument 'a' doesn't match built-in prototype" } */ + register char *a, b; /* { dg-warning "argument 'a' doesn't match built-in prototype" } */ +{ return 0; } diff --git a/gcc/testsuite/gcc.dg/pr20368-1.c b/gcc/testsuite/gcc.dg/pr20368-1.c index ac76c16f783..4140397c142 100644 --- a/gcc/testsuite/gcc.dg/pr20368-1.c +++ b/gcc/testsuite/gcc.dg/pr20368-1.c @@ -6,7 +6,7 @@ extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */ int -f (x) - float x; /* { dg-warning "function declaration isn't a prototype" } */ +f (x) /* { dg-warning "function declaration isn't a prototype" } */ + float x; { } diff --git a/gcc/testsuite/gcc.dg/tree-ssa/col-1.c b/gcc/testsuite/gcc.dg/tree-ssa/col-1.c new file mode 100644 index 00000000000..5838134ad21 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/col-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-tree-gimple-details-lineno" } */ + +void foo (int, int); + +int +m(int x) +{ + int c, a; + a = (c = 5) + 16 + x * 2 ; + foo (c, a); +} + +/* { dg-final { scan-tree-dump-times "10:9.*c = 5" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "10:14.*c . 16" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "10:4.*a =" 1 "gimple" } } */ +/* { dg-final { cleanup-tree-dump "gimple" } } */ diff --git a/gcc/testsuite/gcc.dg/vla-8.c b/gcc/testsuite/gcc.dg/vla-8.c index e4c6ae4157f..1d31876b9b4 100644 --- a/gcc/testsuite/gcc.dg/vla-8.c +++ b/gcc/testsuite/gcc.dg/vla-8.c @@ -23,8 +23,8 @@ void foo1(int n) { } void foo2(int n) { - goto A; /* { dg-error "jump into scope of identifier with variably modified type" } */ + goto A; int (*(*bar2)(void))[n]; - A: + A: /* { dg-error "jump into scope of identifier with variably modified type" } */ ; } |