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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [objc.dg/] [const-str-4.m] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Ensure that the preprocessor handles ObjC string constants gracefully. */
2
/* Author: Ziemowit Laski <zlaski@apple.com> */
3
/* { dg-options "-fnext-runtime -fconstant-string-class=MyString -lobjc" } */
4
/* { dg-do run { target *-*-darwin* } } */
5
 
6
extern void abort(void);
7
 
8
@interface MyString
9
{
10
  void *isa;
11
  char *str;
12
  int len;
13
}
14
@end
15
 
16
#define kMyStringMacro1 "My String"
17
#define kMyStringMacro2 @"My String"
18
 
19
void *_MyStringClassReference;
20
 
21
@implementation MyString
22
@end
23
 
24
int main(void) {
25
  MyString* aString1 = @kMyStringMacro1;
26
  MyString* aString2 = kMyStringMacro2;
27
  if(aString1 != aString2) {
28
    abort();
29
  }
30
  return 0;
31
}

powered by: WebSVN 2.1.0

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