| 1 |
/* Based on a test case contributed by Nicola Pero. */ |
| 2 |
|
| 3 |
/* { dg-do run } */ |
| 4 |
/* { dg-options "-mno-constant-cfstrings -Wno-deprecated-declarations" { target *-*-darwin* } } */ |
| 5 |
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ |
| 6 |
/* { dg-additional-sources "../../../objc-obj-c++-shared/nsconstantstring-class-impl.m" } */ |
| 7 |
|
| 8 |
#include <string.h> |
| 9 |
#include <stdlib.h> |
| 10 |
|
| 11 |
#ifndef __NEXT_RUNTIME__ |
| 12 |
#include <objc/NXConstStr.h> |
| 13 |
#else |
| 14 |
#include "../../../objc-obj-c++-shared/nsconstantstring-class.h" |
| 15 |
#endif |
| 16 |
|
| 17 |
int main(int argc, void **args) |
| 18 |
{ |
| 19 |
if ([@"this is a string" length] != strlen ("this is a string")) |
| 20 |
abort (); |
| 21 |
return 0; |
| 22 |
} |