summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/strings/const-str-1.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc.dg/strings/const-str-1.m')
-rw-r--r--gcc/testsuite/objc.dg/strings/const-str-1.m25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/strings/const-str-1.m b/gcc/testsuite/objc.dg/strings/const-str-1.m
new file mode 100644
index 000000000..754c99bf1
--- /dev/null
+++ b/gcc/testsuite/objc.dg/strings/const-str-1.m
@@ -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");
+}