diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/static1.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.jason/static1.C | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/static1.C b/gcc/testsuite/g++.old-deja/g++.jason/static1.C new file mode 100644 index 00000000000..fd0a937b6eb --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.jason/static1.C @@ -0,0 +1,31 @@ +// PRMS id: 6863 + +extern "C" printf(const char *, ...); +extern "C" void abort(); + +enum ENUM {E1=0, E2 }; +int d; + +class AAA{ +public: + AAA() {a = new char[10];printf("constructor AAA() called\n");} + AAA(int) {printf("constructor AAA(int) called\n");} + ~AAA(){ printf("destructor ~AAA() called\n"); d = 1; } + operator int () { return 1;} + char *a; + int i; +}; + +struct sentinel { + ~sentinel () { if (d == 0) abort (); } +} s; + +/* forward decl here causes gcc not to execute ct and dt for arr1 */ +extern AAA arr1[]; + +AAA arr1[] = {(int)E1 }; + +main() +{ + return 0; +} |