Debian Codegraph @

gcc/testsuite/obj-c++.dg/torture/strings/string1.mm

raw
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/nsconstantstring-class-impl.mm" } */
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, char **args)
18 {
19 if (strcmp ([@"this is a string" cString], "this is a string"))
20 abort ();
21 return 0;
22 }