mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 21:41:47 +08:00
* ld-selective/5.cc: New test.
* ld-selective/selective.exp: Run it as xfailed. * ld-selective/4.cc: Correct spelling of "lose".
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2000-09-29 Hans-Peter Nilsson <hp@bitrange.com>
|
||||||
|
|
||||||
|
* ld-selective/5.cc: New test.
|
||||||
|
* ld-selective/selective.exp: Run it as xfailed.
|
||||||
|
|
||||||
|
* ld-selective/4.cc: Correct spelling of "lose".
|
||||||
|
|
||||||
2000-09-05 Alan Modra <alan@linuxcare.com.au>
|
2000-09-05 Alan Modra <alan@linuxcare.com.au>
|
||||||
|
|
||||||
* ld-selective/selective.exp: Remove the xfails for hppa.
|
* ld-selective/selective.exp: Remove the xfails for hppa.
|
||||||
|
@ -4,7 +4,7 @@ struct A
|
|||||||
virtual void bar();
|
virtual void bar();
|
||||||
};
|
};
|
||||||
|
|
||||||
void A::foo() { } // loose
|
void A::foo() { } // lose
|
||||||
void A::bar() { } // keep
|
void A::bar() { } // keep
|
||||||
|
|
||||||
struct B : public A
|
struct B : public A
|
||||||
@ -12,7 +12,7 @@ struct B : public A
|
|||||||
virtual void foo();
|
virtual void foo();
|
||||||
};
|
};
|
||||||
|
|
||||||
void B::foo() { } // loose
|
void B::foo() { } // lose
|
||||||
|
|
||||||
void _start() __asm__("_start"); // keep
|
void _start() __asm__("_start"); // keep
|
||||||
|
|
||||||
|
32
ld/testsuite/ld-selective/5.cc
Normal file
32
ld/testsuite/ld-selective/5.cc
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
struct A
|
||||||
|
{
|
||||||
|
virtual void foo();
|
||||||
|
virtual void bar();
|
||||||
|
};
|
||||||
|
|
||||||
|
void A::foo() { } // lose
|
||||||
|
void A::bar() { } // keep
|
||||||
|
|
||||||
|
struct B : public A
|
||||||
|
{
|
||||||
|
virtual void foo();
|
||||||
|
};
|
||||||
|
|
||||||
|
void B::foo() { } // lose
|
||||||
|
|
||||||
|
void _start() __asm__("_start"); // keep
|
||||||
|
|
||||||
|
A a; // keep
|
||||||
|
B b;
|
||||||
|
A *getme() { return &a; } // keep
|
||||||
|
|
||||||
|
extern B* dropme2();
|
||||||
|
void dropme1() { dropme2()->foo(); } // lose
|
||||||
|
B *dropme2() { return &b; } // lose
|
||||||
|
|
||||||
|
void _start()
|
||||||
|
{
|
||||||
|
getme()->bar();
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void __main() { }
|
@ -32,6 +32,7 @@ set test2 "selective2"
|
|||||||
set test3 "selective3"
|
set test3 "selective3"
|
||||||
set test4 "selective4"
|
set test4 "selective4"
|
||||||
set test5 "selective5"
|
set test5 "selective5"
|
||||||
|
set test6 "selective6"
|
||||||
|
|
||||||
set cflags "-w -O2 -ffunction-sections -fdata-sections"
|
set cflags "-w -O2 -ffunction-sections -fdata-sections"
|
||||||
set cxxflags "-fvtable-gc -fno-exceptions -fno-rtti"
|
set cxxflags "-fvtable-gc -fno-exceptions -fno-rtti"
|
||||||
@ -43,6 +44,7 @@ if { [which $CXX] == 0 } {
|
|||||||
untested $test3
|
untested $test3
|
||||||
untested $test4
|
untested $test4
|
||||||
untested $test5
|
untested $test5
|
||||||
|
untested $test6
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,3 +193,50 @@ if ![ld_simple_link $ld tmpdir/4.x "$ldflags tmpdir/4.o"] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if { ![ld_compile "$CC $cflags $cxxflags" $srcdir/$subdir/5.cc tmpdir/5.o]} {
|
||||||
|
unresolved $test6
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
# Exposes a bug, currently. FIXME: Fix it.
|
||||||
|
# FIXME: Break out the nesting to a function that takes two lists, one
|
||||||
|
# with expected present symbols, one with expected absent symbols, and
|
||||||
|
# iterates over nm output. Use that function in all tests here.
|
||||||
|
|
||||||
|
setup_xfail "*-*-*"
|
||||||
|
|
||||||
|
if ![ld_simple_link $ld tmpdir/5.x "$ldflags tmpdir/5.o"] {
|
||||||
|
fail $test6
|
||||||
|
} else {
|
||||||
|
if ![ld_nm $nm tmpdir/5.x] {
|
||||||
|
unresolved $test6
|
||||||
|
} else {
|
||||||
|
if {[info exists nm_output(foo__1B)]} {
|
||||||
|
send_log "foo__1B == $nm_output(foo__1B)\n"
|
||||||
|
verbose "foo__1B == $nm_output(foo__1B)"
|
||||||
|
fail $test6
|
||||||
|
} else {
|
||||||
|
if {[info exists nm_output(foo__1A)]} {
|
||||||
|
send_log "foo__1A == $nm_output(foo__1A)\n"
|
||||||
|
verbose "foo__1A == $nm_output(foo__1A)"
|
||||||
|
fail $test6
|
||||||
|
} else {
|
||||||
|
if {[info exists nm_output(dropme1__Fv)]} {
|
||||||
|
send_log "dropme1__Fv == $nm_output(dropme1__Fv)\n"
|
||||||
|
verbose "dropme1__Fv == $nm_output(dropme1__Fv)"
|
||||||
|
fail $test6
|
||||||
|
} else {
|
||||||
|
if {[info exists nm_output(dropme2__Fv)]} {
|
||||||
|
send_log "dropme2__Fv == $nm_output(dropme2__Fv)\n"
|
||||||
|
verbose "dropme2__Fv == $nm_output(dropme2__Fv)"
|
||||||
|
fail $test6
|
||||||
|
} else {
|
||||||
|
pass $test6
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user