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