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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [torture/] [strings/] [const-str-4.m] - Blame information for rev 801

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

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

powered by: WebSVN 2.1.0

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