aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/concat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/concat.c')
-rw-r--r--gcc/testsuite/gcc.dg/concat.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/concat.c b/gcc/testsuite/gcc.dg/concat.c
new file mode 100644
index 00000000000..4f4f8d7b08b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/concat.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+
+/* Test we output a warning for concatenation of artifical strings.
+
+ Neil Booth, 10 Dec 2001. */
+
+void foo ()
+{
+ char str1[] = __FUNCTION__ "."; /* { dg-warning "deprecated" } */
+ char str2[] = __PRETTY_FUNCTION__ ".";/* { dg-warning "deprecated" } */
+ char str3[] = "." __FUNCTION__; /* { dg-warning "deprecated" } */
+ char str4[] = "." __PRETTY_FUNCTION__;/* { dg-warning "deprecated" } */
+ char str5[] = "." "."; /* No warning. */
+}