Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/objc.dg/gnu-runtime-2.m @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* 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, void **args) { if (strcmp ([@"this is a string" cString], "this is a string")) abort (); return 0; }