mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-08 13:57:15 +08:00
Bring over test cases
From-SVN: r15897
This commit is contained in:
parent
dae1d6f685
commit
378ec56d93
37
gcc/testsuite/g++.old-deja/g++.benjamin/.Sanitize
Normal file
37
gcc/testsuite/g++.old-deja/g++.benjamin/.Sanitize
Normal file
@ -0,0 +1,37 @@
|
||||
# .Sanitize for g++ tests.
|
||||
|
||||
# Each directory to survive it's way into a release will need a file
|
||||
# like this one called "./.Sanitize". All keyword lines must exist,
|
||||
# and must exist in the order specified by this file. Each directory
|
||||
# in the tree will be processed, top down, in the following order.
|
||||
|
||||
# Hash started lines like this one are comments and will be deleted
|
||||
# before anything else is done. Blank lines will also be squashed
|
||||
# out.
|
||||
|
||||
# The lines between the "Do-first:" line and the "Things-to-keep:"
|
||||
# line are executed as a /bin/sh shell script before anything else is
|
||||
# done in this directory.
|
||||
|
||||
Do-first:
|
||||
|
||||
# All files listed between the "Things-to-keep:" line and the
|
||||
# "Do-last:" line will be kept. All other files will be removed.
|
||||
# Directories listed in this section will have their own Sanitize
|
||||
# called. Directories not listed will be removed in their entirety
|
||||
# with rm -rf.
|
||||
|
||||
Things-to-keep:
|
||||
|
||||
.cvsignore
|
||||
p12475.C
|
||||
p13417.C
|
||||
warn01.C
|
||||
|
||||
Things-to-lose:
|
||||
|
||||
# The lines between the "Do-last:" line and the end of the file
|
||||
# are executed as a /bin/sh shell script after everything else is
|
||||
# done.
|
||||
|
||||
Do-last:
|
11
gcc/testsuite/g++.old-deja/g++.benjamin/p13417.C
Normal file
11
gcc/testsuite/g++.old-deja/g++.benjamin/p13417.C
Normal file
@ -0,0 +1,11 @@
|
||||
// Build don't link:
|
||||
// Special g++ Options:
|
||||
// prms-id: 13417
|
||||
|
||||
class Foo {
|
||||
public:
|
||||
explicit Foo (int){}
|
||||
};
|
||||
Foo f(10);
|
||||
Foo blat() return f(4){}; //this should not give an error
|
||||
|
98
gcc/testsuite/g++.old-deja/g++.benjamin/warn01.C
Normal file
98
gcc/testsuite/g++.old-deja/g++.benjamin/warn01.C
Normal file
@ -0,0 +1,98 @@
|
||||
// Build don't link:
|
||||
// Special g++ Options: -Wall -Weffc++
|
||||
|
||||
//1 g++/12952 un-named variables in a catch block
|
||||
//Wall or Wunused should not give warnings here
|
||||
template <class T>
|
||||
void f (void) {
|
||||
try
|
||||
{
|
||||
}
|
||||
|
||||
catch( int)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
//2 g++/12923 __attribute__((__unused__)) not working for objects
|
||||
//Weffc++ or Wunused should not report the object as an error
|
||||
class C {
|
||||
public:
|
||||
C();
|
||||
};
|
||||
|
||||
void f (void){
|
||||
C x __attribute__ ((__unused__));
|
||||
int y __attribute__ ((__unused__));
|
||||
}
|
||||
|
||||
//
|
||||
//3 g++/12982 lock should not give error here, as above
|
||||
void setLock ();
|
||||
void clearLock ();
|
||||
|
||||
template <class T>
|
||||
class test {
|
||||
public:
|
||||
class lock
|
||||
{
|
||||
public:
|
||||
lock () { setLock(); }
|
||||
~lock () { clearLock(); }
|
||||
};
|
||||
|
||||
static void f (void)
|
||||
{
|
||||
lock local __attribute__ ((__unused__));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
//4 g++/12988 neither Mutex nor AutoMutex varibles should give warnings here
|
||||
//compile with -Weffc++ or -Wunused depending on post or pre 97r1
|
||||
class Mutex {
|
||||
private:
|
||||
long counter;
|
||||
public:
|
||||
virtual long retcntr() {return counter;};
|
||||
Mutex(int i = 0): counter(i) {};
|
||||
virtual ~Mutex() {};
|
||||
} __attribute__ ((__unused__));
|
||||
|
||||
class AutoMutex: public Mutex{
|
||||
private:
|
||||
long counter2;
|
||||
public:
|
||||
long retcntr() {return counter2;};
|
||||
AutoMutex(int i = 0): counter2(i) {};
|
||||
virtual ~AutoMutex() {};
|
||||
} __attribute__ ((__unused__));
|
||||
|
||||
|
||||
template <class T>
|
||||
int foofunc(T x){
|
||||
Mutex sm(2);
|
||||
AutoMutex m(&sm);
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
//5 sanity check to make sure other attributes cannot be used
|
||||
class Mutex2 {
|
||||
private:
|
||||
long counter;
|
||||
public:
|
||||
virtual long retcntr() {return counter;};
|
||||
Mutex2(int i = 0): counter(i) {};
|
||||
virtual ~Mutex2() {};
|
||||
} __attribute__ ((warn)); // WARNING -
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user