diff options
author | no-author <no-author@gcc.gnu.org> | 2005-04-09 00:11:45 +0000 |
---|---|---|
committer | no-author <no-author@gcc.gnu.org> | 2005-04-09 00:11:45 +0000 |
commit | 5eab04e3e7ca94ff864fbb7ed6b5108046fcc965 (patch) | |
tree | b4a1396984944d44fa14f65582823ad3af69d741 /gcc/testsuite/g++.dg/pascal-strings-3.C | |
parent | 9e88bc8754ac91301313180a1f11bbf74ed1a9dc (diff) |
This commit was manufactured by cvs2svn to create tagapple/gcc-5004
'apple-gcc-5004'.
git-svn-id: https://gcc.gnu.org/svn/gcc/tags/apple-gcc-5004@97875 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/pascal-strings-3.C')
-rw-r--r-- | gcc/testsuite/g++.dg/pascal-strings-3.C | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/pascal-strings-3.C b/gcc/testsuite/g++.dg/pascal-strings-3.C new file mode 100644 index 00000000000..7c7cf8139ed --- /dev/null +++ b/gcc/testsuite/g++.dg/pascal-strings-3.C @@ -0,0 +1,20 @@ +/* APPLE LOCAL file pascal strings */ +/* Ensure that there are no warnings or errors issued when a Pascal string is used to + initialize an array and the NUL terminator does not fit. */ +/* Author: Ziemowit Laski <zlaski@apple.com> */ + +/* { dg-do compile } */ +/* { dg-options "-fpascal-strings" } */ + +typedef unsigned char Str15[16]; + +Str15 ggg = "\p012345678901234"; +Str15 hhh = "\p0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */ + +int foo(void) +{ + Str15 sss = "\p012345678901234"; + Str15 ttt = "\p0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */ + + return 0; +} |