mirror of
https://github.com/autc04/Retro68.git
synced 2024-06-28 11:30:19 +00:00
31 lines
711 B
Plaintext
31 lines
711 B
Plaintext
/* Sanity check for GNU-runtime version of constant strings,
|
|
regardless of runtime used on target system. */
|
|
|
|
/* { dg-do compile } */
|
|
/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
|
|
|
|
#include <objc/Object.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
|
|
@interface NXConstantString: Object
|
|
{
|
|
char *c_string;
|
|
unsigned int len;
|
|
}
|
|
-(const char *) cString;
|
|
-(unsigned int) length;
|
|
@end
|
|
|
|
@implementation NXConstantString
|
|
-(const char *) cString { return c_string; }
|
|
-(unsigned int) length { return len; }
|
|
@end
|
|
|
|
int main(int argc, const char **args)
|
|
{
|
|
if (strcmp ([@"this is a string" cString], "this is a string"))
|
|
abort ();
|
|
return 0;
|
|
}
|