brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 2a071c8 Raw
43 lines · c
1/* RUN: %clang_cc1 -fsyntax-only -std=c89 -Wimplicit-int %s -verify -Wno-strict-prototypes2   RUN: %clang_cc1 -fsyntax-only -std=c99 %s -verify=ext -Wno-strict-prototypes3   RUN: %clang_cc1 -fsyntax-only -std=c2x %s -verify=unsupported4*/5 6foo(void) { /* expected-warning {{type specifier missing, defaults to 'int'}} \7               ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \8               unsupported-error {{a type specifier is required for all declarations}} */9  return 0;10}11 12y;  /* expected-warning {{type specifier missing, defaults to 'int'}} \13       ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \14       unsupported-error {{a type specifier is required for all declarations}} */15 16void f((x));  /* expected-warning {{type specifier missing, defaults to 'int'}} \17                 ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \18                 unsupported-error {{a type specifier is required for all declarations}} */19 20/* PR3702 */21#define PAD(ms10) { \22    register i;     \23}24 25#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */26 27void28h19_insline(n)  /* ext-error {{parameter 'n' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}} \29                   unsupported-error {{unknown type name 'n'}} */30{31  ILPAD();  /* expected-warning {{type specifier missing, defaults to 'int'}} \32               ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \33               unsupported-error {{a type specifier is required for all declarations}} */34 35}36 37struct foo {38 __extension__ __attribute__((packed)) x : 4; /* expected-warning {{type specifier missing, defaults to 'int'}} \39                                                 ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \40                                                 unsupported-error {{unknown type name 'x'}} */41 42};43