Handle $srcdir/lib/attributes.h using lappend_include_dir.
Tested on x86_64-linux.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "../lib/attributes.h"
+#include "attributes.h"
int __attribute__((noinline)) ATTRIBUTE_NOCLONE
baz ()
standard_testfile
-if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
+set flags {}
+lappend flags debug
+lappend_include_file flags $srcdir/lib/attributes.h
+
+if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } {
return -1
}
standard_testfile backtrace.c
-if { [build_executable "failed to prepare" $testfile $srcfile] } {
+set flags {}
+lappend flags debug
+lappend_include_file flags $srcdir/lib/attributes.h
+
+if { [build_executable "failed to prepare" $testfile $srcfile $flags] } {
return -1
}
in the structs.exp test script. */
#include <string.h>
-#include "../lib/attributes.h"
+#include "attributes.h"
/* Useful abreviations. */
typedef char tc;
lappend compile_flags "additional_flags=-Wno-tautological-compare"
}
+lappend_include_file compile_flags $srcdir/lib/attributes.h
+
# Given N (0..25), return the corresponding alphabetic letter in upper
# case.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "../lib/attributes.h"
+#include "attributes.h"
#if USE_SEMAPHORES
proc stap_test {exec_name {args ""}} {
global testfile hex srcfile
+ set flags {}
+ lappend flags debug
+ lappend_include_file flags $::srcdir/lib/attributes.h
+ if { $args != "" } {
+ set flags [concat $flags $args]
+ }
+
if {[prepare_for_testing "failed to prepare" ${exec_name} $srcfile \
- [concat $args debug]]} {
+ $flags]} {
return -1
}
}
proc stap_test_no_debuginfo {exec_name {args ""}} {
- global testfile hex
+ global hex
+
+ set flags {}
+ lappend flags nodebug
+ lappend flags optimize=-O2
+ lappend_include_file flags $::srcdir/lib/attributes.h
+ if { $args != "" } {
+ set flags [concat $flags $args]
+ }
- if {[prepare_for_testing "failed to prepare" ${exec_name} ${testfile}.c \
- [concat $args nodebug optimize=-O2]]} {
+ if {[prepare_for_testing "failed to prepare" ${exec_name} $::srcfile \
+ $flags]} {
return -1
}
/* The version of this test-case with f1 tagged with noinline only is equivalent
to gcc/testsuite/gcc.dg/guality/vla-1.c. */
-#include "../lib/attributes.h"
+#include "attributes.h"
int
#ifdef NOCLONE
global testfile srcfile
lassign $options compile_flags sizeof_result
+ lappend_include_file compile_flags $::srcdir/lib/attributes.h
if { [prepare_for_testing "failed to prepare" "$testfile-$exe_suffix" $srcfile \
$compile_flags] } {
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdlib.h>
-#include "../lib/attributes.h"
+#include "attributes.h"
int a;
int b;
standard_testfile .cc
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
- {debug c++ optimize=-O2}]} {
+set flags {}
+lappend flags debug
+lappend flags c++
+lappend flags optimize=-O2
+lappend_include_file flags $srcdir/lib/attributes.h
+
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
return -1
}
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "../lib/attributes.h"
+#include "attributes.h"
/* Our fake dynamic object. */
void *dyn_object;
standard_testfile .c -dw.S
-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
+set flags {}
+lappend flags debug
+lappend_include_file flags $srcdir/lib/attributes.h
+
+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $flags] } {
return -1
}
+with_shared_gdb {
+ set func_info_vars [get_func_info main $flags]
+
+ set int_size [get_sizeof "int" "UNKNOWN"]
+ set voidp_size [get_sizeof "void *" "UNKNOWN"]
+}
+
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
+ global func_info_vars
+ foreach var $func_info_vars {
+ global $var
+ }
+ global int_size
+ global voidp_size
+
cu {} {
global srcfile
} {
declare_labels array_type_label integer_type_label
- set int_size [get_sizeof "int" "UNKNOWN"]
- set voidp_size [get_sizeof "void *" "UNKNOWN"]
-
integer_type_label: DW_TAG_base_type {
{DW_AT_byte_size $int_size DW_FORM_sdata}
{DW_AT_encoding @DW_ATE_signed}
{name "dyn_object"}
{type :$array_type_label}
}
- subprogram {
- {external 1 flag}
- {MACRO_AT_func {main}}
- }
+ subprogram {
+ {external 1 flag}
+ {DW_AT_name main}
+ {DW_AT_low_pc $main_start DW_FORM_addr}
+ {DW_AT_high_pc $main_end DW_FORM_addr}
+ }
}
}
}
+set flags {}
+lappend flags {nodebug}
+lappend_include_file flags $srcdir/lib/attributes.h
+
if { [prepare_for_testing "failed to prepare" "${testfile}" \
- [list $srcfile $asm_file] {nodebug}] } {
+ [list $srcfile $asm_file] $flags] } {
return -1
}
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "../lib/attributes.h"
+#include "attributes.h"
volatile int val;
standard_testfile
-if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
+set flags {}
+lappend flags debug
+lappend_include_file flags $srcdir/lib/attributes.h
+
+if {[build_executable "failed to prepare" ${testfile} ${srcfile} $flags] == -1} {
return -1
}