aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/pascal-strings-2.mm
blob: ef3369904552dbbc8b6c6aacab84c8bb83edbd9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* APPLE LOCAL file pascal strings */
/* Ensure that Pascal strings do not get confused with ordinary C strings when 
   -funsigned-char is being used.  */
/* Author: Ziemowit Laski <zlaski@apple.com> */

/* { dg-do compile } */
/* { dg-options "-fpascal-strings -funsigned-char" } */

typedef unsigned char Str15[16];

Str15 ggg = "\p012345678901234";
Str15 hhh = "0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */

int foo(void)
{
  Str15 sss = "\p012345678901234";
  Str15 ttt = "0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */

  return 0;
}