1 # Copyright 2014-2015 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
365 extern func_start func_end ptr
369 {language @DW_LANG_C}
370 {low_pc func_start addr}
371 {high_pc func_end addr}
375 int_label: base_type {
378 {encoding @DW_ATE_signed}
384 {low_pc func_start addr}
385 {high_pc func_end addr}
389 {variable_parameter 1 flag}
391 {location $program SPECIAL_expr}
396 {variable_parameter 1 flag}
404 if { [prepare_for_testing ${testfile}.exp ${testfile} \
405 [list $srcfile $asm_file] {nodebug}] } {
413 if {[skip_compile_feature_tests]} {
414 untested "compile command not supported (could not find libcc1 shared library?)"
418 # If we have a bug, this will hang.
419 gdb_test_no_output "compile code param"
421 # We can't access optimized-out variables, but their presence should
422 # not affect compilations that don't refer to them.
423 gdb_test "compile code optimized_out" \
424 ".*optimized out.*Compilation failed."