1 # Copyright 2014-2021 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 # Some coverage testing of DWARF operators for the compiler
21 # This test can only be run on targets which support DWARF-2 and use gas.
22 if {![dwarf2_support]} {
26 standard_testfile .c gdbjit-ops.S
29 # A port of the pr10770.c test code to the DWARF assembler format.
37 set assert_tos_0 [subst {
175 # Divide is signed truncating toward zero.
188 # Modulo is unsigned.
207 # Signed modulo can be implemented using 'over over div mul minus'.
353 # Finally some result.
357 # Make some DWARF for the test.
358 set asm_file [standard_output_file $srcfile2]
359 Dwarf::assemble $asm_file {
360 # Creating a CU with 4-byte addresses lets this test link on both
361 # 32- and 64-bit machines.
364 declare_labels int_label
368 {language @DW_LANG_C}
369 {low_pc func_start addr}
370 {high_pc func_end addr}
374 int_label: base_type {
377 {encoding @DW_ATE_signed}
383 {low_pc func_start addr}
384 {high_pc func_end addr}
388 {variable_parameter 1 flag}
390 {location $program SPECIAL_expr}
395 {variable_parameter 1 flag}
403 if { [prepare_for_testing "failed to prepare" ${testfile} \
404 [list $srcfile $asm_file] {nodebug}] } {
412 if {[skip_compile_feature_tests]} {
413 untested "compile command not supported (could not find libcc1 shared library?)"
417 # If we have a bug, this will hang.
418 gdb_test_no_output "compile code (void) param"
420 # We can't access optimized-out variables, but their presence should
421 # not affect compilations that don't refer to them.
422 gdb_test "compile code optimized_out" \
423 ".*optimized out.*Compilation failed."