OSDN Git Service

CFStrings for Darwin
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / torture / strings / string1.m
1 /* Based on a test case contributed by Nicola Pero.  */
2
3 /* { dg-do run } */
4 /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */
5 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
6 /* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.m" } */
7
8 #include "../../../objc-obj-c++-shared/Object1.h"
9 #include "../../../objc-obj-c++-shared/next-mapping.h"
10
11 #include <string.h>
12 #include <stdlib.h>
13
14 #ifndef __NEXT_RUNTIME__
15 #include <objc/NXConstStr.h>
16 #endif
17
18 int main(int argc, void **args)
19 {
20   if (strcmp ([@"this is a string" cString], "this is a string"))
21     abort ();
22   return 0;
23 }