URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
// A basic sanity check for Objective-C++.
|
// A basic sanity check for Objective-C++.
|
// { dg-do run }
|
// { dg-do run }
|
|
|
#include
|
#include
|
#include
|
#include
|
|
|
@interface Greeter : Object
|
@interface Greeter : Object
|
- (void) greet: (const char *)msg;
|
- (void) greet: (const char *)msg;
|
@end
|
@end
|
|
|
@implementation Greeter
|
@implementation Greeter
|
- (void) greet: (const char *)msg { std::cout << msg; }
|
- (void) greet: (const char *)msg { std::cout << msg; }
|
@end
|
@end
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
std::cout << "Hello from C++\n";
|
std::cout << "Hello from C++\n";
|
Greeter *obj = [Greeter new];
|
Greeter *obj = [Greeter new];
|
[obj greet: "Hello from Objective-C\n"];
|
[obj greet: "Hello from Objective-C\n"];
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.