diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-26 02:00:19 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-26 02:00:19 +0000 |
commit | edf98e3aa4f6d9abbae19de7377be7556d9f61ce (patch) | |
tree | ddad21bad1f626039f24ed2f1b5d29db1057a44b /gcc | |
parent | 79c191c0a2ed69822898475c3649021b05f15096 (diff) | |
download | gcc-edf98e3aa4f6d9abbae19de7377be7556d9f61ce.tar.gz |
* obj-c++.dg/basic.mm: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100182 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 1 | ||||
-rw-r--r-- | gcc/testsuite/obj-c++.dg/basic.mm | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5a9258b018d..0944c2943d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -6,6 +6,7 @@ * obj-c++.dg/selector-1.mm: Move to... * obj-c++.dg/selector-4.mm: here... + * obj-c++.dg/basic.mm: New. * obj-c++.dg/comp-types-1.mm: New. * obj-c++.dg/cxx-class-1.mm: New. * obj-c++.dg/cxx-ivars-1.mm: New. diff --git a/gcc/testsuite/obj-c++.dg/basic.mm b/gcc/testsuite/obj-c++.dg/basic.mm new file mode 100644 index 00000000000..5a9fb430e06 --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/basic.mm @@ -0,0 +1,21 @@ +// A basic sanity check for Objective-C++. +// { dg-do run } + +#include <objc/Object.h> +#include <iostream> + +@interface Greeter : Object +- (void) greet: (const char *)msg; +@end + +@implementation Greeter +- (void) greet: (const char *)msg { std::cout << msg; } +@end + +int +main () +{ + std::cout << "Hello from C++\n"; + Greeter *obj = [Greeter new]; + [obj greet: "Hello from Objective-C\n"]; +} |