1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcxx-exceptions -fexceptions -O0 -verify %s
2 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcxx-exceptions -fexceptions -pedantic-errors -DPE -O0 -verify %s
5 // expected-no-diagnostics
8 extern "C" int printf(const char*, ...);
12 S() __attribute__ ((nothrow
)) { printf("%d: S()\n", ++N
); }
13 ~S() __attribute__ ((nothrow
)) { printf("%d: ~S()\n", N
--); }
17 void print(int n
, int a
, int b
, int c
, int d
) {
18 printf("n=%d\n,sizeof(S)=%d\nsizeof(array_t[0][0])=%d\nsizeof(array_t[0])=%d\nsizeof(array_t)=%d\n",
26 // expected-error@-2 {{variable length arrays are a C99 feature}} expected-note@-2 {{parameter}} expected-note@-3 {{here}}
27 // expected-error@-3 {{variable length arrays are a C99 feature}} expected-note@-3 {{parameter}} expected-note@-4 {{here}}
29 int sizeof_S
= sizeof(S
);
30 int sizeof_array_t_0_0
= sizeof(array_t
[0][0]);
31 int sizeof_array_t_0
= sizeof(array_t
[0]);
32 int sizeof_array_t
= sizeof(array_t
);
33 print(n
, sizeof_S
, sizeof_array_t_0_0
, sizeof_array_t_0
, sizeof_array_t
);
41 printf("exception %d\n", e
);
46 printf("exception %d", e
);