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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc.dg/] [const-str-4.m] - Rev 816

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

/* Ensure that the preprocessor handles ObjC string constants gracefully. */
/* Author: Ziemowit Laski <zlaski@apple.com> */
/* { dg-options "-fconstant-string-class=MyString " } */ 
/* { dg-do run  } */
 
extern void abort(void);
 
@interface MyString
{
  void *isa;
  char *str;
  int len;
}
@end
 
#define kMyStringMacro1 "My String"
#define kMyStringMacro2 @"My String"
 
void *_MyStringClassReference;
 
@implementation MyString
@end
 
int main(void) {
  MyString* aString1 = @kMyStringMacro1;
  MyString* aString2 = kMyStringMacro2;
  if(aString1 != aString2) {
    abort();
  }
  return 0;
}
 

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

powered by: WebSVN 2.1.0

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