Debian Codegraph @

gcc/testsuite/objc.dg/torture/strings/string2.m

raw
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 (strcmp ([@"this " @"is " @"a " @"string" cString],
20 "this " "is " "a " "string"))
21 abort ();
22 return 0;
23 }