summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/string2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/string2.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/string2.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/string2.C b/gcc/testsuite/g++.old-deja/g++.other/string2.C
new file mode 100644
index 000000000..bf0699a1d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/string2.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 Mar 2000 <nathan@codesourcery.com>
+
+// A char const array should never be confused for a string literal.
+
+int main ()
+{
+ static const char ary[] = "wibble";
+ void const *ptr = 0;
+
+ ptr = ary;
+ if (ptr == "wibble")
+ return 1;
+ if (ptr != ary)
+ return 1;
+ return 0;
+}