| 1 |
// A basic sanity check for Objective-C++. |
| 2 |
// { dg-do run } |
| 3 |
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ |
| 4 |
|
| 5 |
#include "../objc-obj-c++-shared/TestsuiteObject.m" |
| 6 |
#include <iostream> |
| 7 |
|
| 8 |
@interface Greeter : TestsuiteObject |
| 9 |
- (void) greet: (const char *)msg; |
| 10 |
@end |
| 11 |
|
| 12 |
@implementation Greeter |
| 13 |
- (void) greet: (const char *)msg |
| 14 |
{ std::cout << msg << __VERSION__ << std::endl;} |
| 15 |
@end |
| 16 |
|
| 17 |
int |
| 18 |
main () |
| 19 |
{ |
| 20 |
std::cout << "Hello from C++" << __VERSION__ << std::endl; |
| 21 |
Greeter *obj = [Greeter new]; |
| 22 |
[obj greet: "Hello from Objective-C++"]; |
| 23 |
} |
| 24 |
|