diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2005-08-31 13:46:06 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2005-08-31 06:46:06 -0700 |
commit | 793244425118c9eda89e63ef666e2bd67a1692d7 (patch) | |
tree | a2b11b5bf0e81f044ac467f6c07aa374c52d7b3d /gcc/testsuite/obj-c++.dg | |
parent | ee5426a488f8b28099c6f462aef34b157182d2ac (diff) | |
download | gcc-793244425118c9eda89e63ef666e2bd67a1692d7.zip gcc-793244425118c9eda89e63ef666e2bd67a1692d7.tar.gz gcc-793244425118c9eda89e63ef666e2bd67a1692d7.tar.bz2 |
re PR objc++/23640 (obj-c++ does not call __objc_exec_class for the classes)
2005-08-31 Andrew Pinski <pinskia@physics.uc.edu>
PR obj-c++/23640
* decl2.c (cp_finish_file): If this is obj-c++ and we need a static
init, call generate_ctor_or_dtor_function.
2005-08-31 Andrew Pinski <pinskia@physics.uc.edu>
PR obj-c++/23640
* obj-c++.dg/gnu-runtime-3.mm: New test.
From-SVN: r103673
Diffstat (limited to 'gcc/testsuite/obj-c++.dg')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/gnu-runtime-3.mm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/gnu-runtime-3.mm b/gcc/testsuite/obj-c++.dg/gnu-runtime-3.mm new file mode 100644 index 0000000..04671eb --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/gnu-runtime-3.mm @@ -0,0 +1,31 @@ +/* Test that compiling for the GNU runtime works (regardless of + the system runtime used). */ +/* Author: Ziemowit Laski <zlaski@apple.com> */ +/* { dg-do run } */ +/* { dg-options "-fgnu-runtime" } */ + +#include <objc/Object.h> + +@interface FooBar: Object +- (void)boo; +@end + +int called = 0; +extern "C" void abort (); + +@implementation FooBar +- (void)boo +{ + called ++; +} +@end + +int main () +{ + id fooBarInst = [[FooBar alloc] init]; + [fooBarInst boo]; + if (called != 1) + abort (); + return 0; +} + |