annotate clang/test/Sema/implicit-int.c @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
1 /* RUN: %clang_cc1 -fsyntax-only -std=c89 -Wimplicit-int %s -verify -Wno-strict-prototypes
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
2 RUN: %clang_cc1 -fsyntax-only -std=c99 %s -verify=ext -Wno-strict-prototypes
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
3 RUN: %clang_cc1 -fsyntax-only -std=c2x %s -verify=unsupported
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
4 */
150
anatofuz
parents:
diff changeset
5
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
6 foo(void) { /* expected-warning {{type specifier missing, defaults to 'int'}} \
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
7 ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
8 unsupported-error {{a type specifier is required for all declarations}} */
150
anatofuz
parents:
diff changeset
9 return 0;
anatofuz
parents:
diff changeset
10 }
anatofuz
parents:
diff changeset
11
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
12 y; /* expected-warning {{type specifier missing, defaults to 'int'}} \
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
13 ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
14 unsupported-error {{a type specifier is required for all declarations}} */
150
anatofuz
parents:
diff changeset
15
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
16 /* rdar://6131634 */
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
17 void f((x)); /* expected-warning {{type specifier missing, defaults to 'int'}} \
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
18 ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
19 unsupported-error {{a type specifier is required for all declarations}} */
150
anatofuz
parents:
diff changeset
20
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
21 /* PR3702 */
150
anatofuz
parents:
diff changeset
22 #define PAD(ms10) { \
anatofuz
parents:
diff changeset
23 register i; \
anatofuz
parents:
diff changeset
24 }
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 #define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 void
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
29 h19_insline(n) /* ext-error {{parameter 'n' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}} \
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
30 unsupported-error {{unknown type name 'n'}} */
150
anatofuz
parents:
diff changeset
31 {
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
32 ILPAD(); /* expected-warning {{type specifier missing, defaults to 'int'}} \
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
33 ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
34 unsupported-error {{a type specifier is required for all declarations}} */
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
35
150
anatofuz
parents:
diff changeset
36 }
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 struct foo {
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
39 __extension__ __attribute__((packed)) x : 4; /* expected-warning {{type specifier missing, defaults to 'int'}} \
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
40 ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
41 unsupported-error {{unknown type name 'x'}} */
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
42
150
anatofuz
parents:
diff changeset
43 };