diff options
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/strings/const-str-1.mm')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/strings/const-str-1.mm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/strings/const-str-1.mm b/gcc/testsuite/obj-c++.dg/strings/const-str-1.mm new file mode 100644 index 000000000..754c99bf1 --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/strings/const-str-1.mm @@ -0,0 +1,25 @@ +/* Test errors for constant strings. */ +/* { dg-do compile } */ +/* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ + +#ifdef __cplusplus +extern void baz(...); +#endif + +void foo() +{ + baz(@"hiya"); /* { dg-error "annot find interface declaration" } */ +} + +@interface NXConstantString +{ + void *isa; + char *str; + int len; +} +@end + +void bar() +{ + baz(@"howdah"); +} |