llvm-project
97 строк · 2.3 Кб
1// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -fblocks %s
2
3// PR2241
4float test2241[2] = {51e, // expected-error {{exponent}}61ee0 // expected-error {{exponent}}7};8
9
10// Testcase derived from PR2692
11static void f (char * (*g) (char **, int), char **p, ...) {12char *s;13va_list v; // expected-error {{identifier}}14s = g (p, __builtin_va_arg(v, int)); // expected-error {{identifier}}15}
16
17
18// PR3172
19} // expected-error {{extraneous closing brace ('}')}}20
21
22void test(int a) {23struct { int i; } x;24
25if (x.hello) // expected-error {{no member named 'hello'}}26test(0);27else28;29
30if (x.hello == 0) // expected-error {{no member named 'hello'}}31test(0);32else33;34
35if ((x.hello == 0)) // expected-error {{no member named 'hello'}}36test(0);37else38;39
40// PR1259541if (x.i == 0)) // expected-error {{extraneous ')' after condition, expected a statement}}42test(0);43else44;45}
46
47
48
49char (((( /* expected-note {{to match this '('}} */50*X x ] )))); /* expected-error {{expected ')'}} */51
52; // expected-warning {{extra ';' outside of a function}}53
54
55
56
57struct S { void *X, *Y; };58
59struct S A = {60&BADIDENT, 0 /* expected-error {{use of undeclared identifier}} */61};62
63void test6248081(void) {64[10] // expected-error {{expected expression}}65}
66
67struct forward; // expected-note{{forward declaration of 'struct forward'}}68void x(struct forward* x) {switch(x->a) {}} // expected-error {{incomplete definition of type}}69
70// PR3410
71void foo(void) {72int X;73X = 4 // expected-error{{expected ';' after expression}}74}
75
76void test9045701(int x) {77#define VALUE 078x = VALUE // expected-error{{expected ';' after expression}}79}
80
81typedef int intptr_t; // expected-note {{'intptr_t' declared here}}82void bar(intptr y); // expected-error {{unknown type name 'intptr'; did you mean 'intptr_t'?}}83
84void test1(void) {85int x = 2: // expected-error {{expected ';' at end of declaration}}86int y = x;87int z = y;88}
89
90void test2(int x) {91#define VALUE2 VALUE+VALUE92#define VALUE3 VALUE+093#define VALUE4(x) x+094x = VALUE2 // expected-error{{expected ';' after expression}}95x = VALUE3 // expected-error{{expected ';' after expression}}96x = VALUE4(0) // expected-error{{expected ';' after expression}}97}
98