URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/gnu-old/gcc-4.2.2/libmudflap/testsuite/libmudflap.c++
- from Rev 154 to Rev 816
- ↔ Reverse comparison
Rev 154 → Rev 816
/fail24-frag.cxx
0,0 → 1,16
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
|
char zoo [10]; |
|
int main () |
{ |
int i = strlen ("twelve") + strlen ("zero") + strlen ("seventeen"); |
zoo[i] = 'a'; |
return 0; |
} |
/* { dg-output "mudflap violation 1.*" } */ |
/* { dg-output "Nearby object.*" } */ |
/* { dg-output "mudflap object.*zoo.*static.*" } */ |
/* { dg-do run { xfail *-*-* } } */ |
/pass57-frag.cxx
0,0 → 1,25
#include <vector> |
#include <string> |
|
class fitscolumn |
{ |
private: |
std::string name_, unit_; |
int i, t; |
public: |
fitscolumn (const std::string &nm, const std::string &un,int i1,int t1) |
: name_(nm), unit_(un), i(i1), t(t1){} |
}; |
|
void init_bintab(std::vector<fitscolumn> & columns_) |
{ |
char ttype[81], tunit[81], tform[81]; |
long repc; |
int typecode; |
columns_.push_back (fitscolumn (ttype,tunit,1,typecode)); |
} |
|
int main () |
{ |
return 0; |
} |
/pass58-frag.cxx
0,0 → 1,12
// PR 19319 |
struct k { |
int data; |
k(int j): data(j) {} |
}; |
k make_k () { return k(1); } |
|
int main () |
{ |
k foo = make_k (); |
return 0; |
} |
/ctors.exp
0,0 → 1,48
global MUDFLAP_FLAGS |
set MUDFLAP_FLAGS [list {} {-static} {-O2} {-O3}] |
|
libmudflap-init c++ |
if {$cxx == "g++"} then { |
unsupported "g++ not found" |
return |
} |
|
dg-init |
|
global srcdir subdir |
|
foreach flags $MUDFLAP_FLAGS { |
set l1 [libmudflap_target_compile "$srcdir/$subdir/ctors-1.cxx" "ctors-1.o" object {additional_flags=-fmudflap}] |
set test "ctors-1 compilation ${flags}" |
if [string match "*mudflap cannot track unknown size extern *k*" $l1] { pass $test } { fail $test } |
|
set l2 [libmudflap_target_compile "$srcdir/$subdir/ctors-2.cxx" "ctors-2.o" object {additional_flags=-fmudflap}] |
set test "ctors-2 compilation ${flags}" |
if [string match "" $l2] { pass $test } { fail $test } |
|
set l3 [libmudflap_target_compile "ctors-1.o ctors-2.o" "ctors-12.exe" executable {additional_flags=-fmudflap additional_flags=-lmudflap additional_flags=-lstdc++}] |
set test "ctors-12 linkage ${flags}" |
if [string match "" $l3] { pass $test } { fail $test } |
|
set l4 [libmudflap_target_compile "ctors-2.o ctors-1.o" "ctors-21.exe" executable {additional_flags=-fmudflap additional_flags=-lmudflap additional_flags=-lstdc++}] |
set test "ctors-21 linkage ${flags}" |
if [string match "" $l3] { pass $test } { fail $test } |
|
setenv MUDFLAP_OPTIONS "-viol-segv" |
|
remote_spawn host "./ctors-12.exe" |
set l5 [remote_wait host 10] |
set test "ctors-12 execution ${flags}" |
if {[lindex $l5 0] == 0} { pass $test } { fail $test } |
|
remote_spawn host "./ctors-21.exe" |
set l6 [remote_wait host 10] |
set test "ctors-21 execution ${flags}" |
if {[lindex $l6 0] == 0} { pass $test } { fail $test } |
|
foreach f [glob -nocomplain "ctors-*"] { |
remote_file build delete $f |
} |
} |
|
dg-finish |
/c++frags.exp
0,0 → 1,22
global MUDFLAP_FLAGS |
set MUDFLAP_FLAGS [list {} {-static} { -O} {-O2} {-O3}] |
|
libmudflap-init c++ |
if {$cxx == "g++"} then { |
unsupported "g++ not found" |
return |
} |
|
dg-init |
|
global srcdir |
|
foreach flags $MUDFLAP_FLAGS { |
foreach srcfile [lsort [glob -nocomplain ${srcdir}/libmudflap.c++/*frag.cxx]] { |
set bsrc [file tail $srcfile] |
setenv MUDFLAP_OPTIONS "-viol-segv" |
dg-runtest $srcfile $flags "-fmudflap -lmudflap" |
} |
} |
|
dg-finish |
/error1-frag.cxx
0,0 → 1,5
// PR 26789 |
// { dg-do compile } |
|
struct A; |
A a; // { dg-error "incomplete" } |
/pass31-frag.cxx
0,0 → 1,12
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
|
char zoo [10]; |
|
int main () |
{ |
int i = strlen ("eight") + strlen ("one"); |
zoo[i] = 'a'; |
return 0; |
} |
/ctors-1.cxx
0,0 → 1,20
#include <iostream> |
|
|
extern char k []; |
|
class foo |
{ |
public: |
foo (char *m) { m [40] = 20; } |
}; |
|
|
foo f1 (k); |
foo f2 (k); |
foo f3 (k); |
|
int main () |
{ |
return 0; |
} |
/error2-frag.cxx
0,0 → 1,10
// PR 26790 |
// { dg-do compile } |
|
struct A; |
|
A foo() // { dg-error "incomplete" } |
{ |
A a; // { dg-error "incomplete" } |
return a; |
} |
/pass41-frag.cxx
0,0 → 1,10
#include <string> |
#include <iostream> |
|
int |
main (int argc, char *argv[]) |
{ |
std::string myStr = "Hello, World!"; |
std::cout << myStr << std::endl; |
return 0; |
} |
/ctors-2.cxx
0,0 → 1,10
char k [500]; |
/pass27-frag.cxx
0,0 → 1,12
class foo { |
char z [10]; |
public: |
char *get_z () { return & this->z[0]; } |
}; |
|
int main () |
{ |
foo x; |
x.get_z()[9] = 'a'; |
return 0; |
} |
/pass28-frag.cxx
0,0 → 1,20
class foo { |
char z [10]; |
public: |
virtual char *get_z () { return & this->z[0]; } |
}; |
|
class bar: public foo { |
char q [20]; |
public: |
char *get_z () { return & this->q[0]; } |
}; |
|
int main () { |
foo *x = new bar (); |
|
x->get_z()[9] = 'a'; |
|
delete x; |
return 0; |
} |
/pass55-frag.cxx
0,0 → 1,7
#include <vector> |
|
int main() { |
std::vector<int> v; |
v.push_back(1); |
return 0; |
} |