OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [obj-c++.dg/] [basic.mm] - Blame information for rev 308

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 308 jeremybenn
// 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
#include "../objc-obj-c++-shared/Object1.h"
5
#include 
6
 
7
@interface Greeter : Object
8
- (void) greet: (const char *)msg;
9
@end
10
 
11
@implementation Greeter
12
- (void) greet: (const char *)msg { std::cout << msg; }
13
@end
14
 
15
int
16
main ()
17
{
18
  std::cout << "Hello from C++\n";
19
  Greeter *obj = [Greeter new];
20
  [obj greet: "Hello from Objective-C\n"];
21
}
22
#include "../objc-obj-c++-shared/Object1-implementation.h"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.