aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.apple/const-cfstring-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.apple/const-cfstring-2.c')
-rw-r--r--gcc/testsuite/gcc.apple/const-cfstring-2.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.apple/const-cfstring-2.c b/gcc/testsuite/gcc.apple/const-cfstring-2.c
new file mode 100644
index 00000000000..cbf09d3a977
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/const-cfstring-2.c
@@ -0,0 +1,13 @@
+/* APPLE LOCAL file constant CFStrings */
+/* Test whether the __builtin__CFStringMakeConstantString
+ "function" fails gracefully when used without the
+ -fconstant-cfstrings flag. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-options "-fno-constant-cfstrings" } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+typedef const struct __CFString *CFStringRef;
+
+const CFStringRef S = ((CFStringRef)__builtin___CFStringMakeConstantString("Testing"));
+/* { dg-error "built-in" "built-in function .* requires .* flag" { target *-*-* } 12 } */