Skip to content

Commit 45821fd

Browse files
committed
add additional tests
1 parent 26987a7 commit 45821fd

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -Wno-strict-prototypes -pedantic %s
2+
* RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -Wno-strict-prototypes -Wmain-return-type %s
3+
* RUN: %clang_cc1 -std=c89 -fsyntax-only -verify=implicit-main-return -Wno-strict-prototypes -pedantic -Wno-main-return-type %s
4+
*/
5+
6+
/* implicit-main-return-no-diagnostics */
7+
8+
int main() {
9+
10+
} /* expected-warning {{implicit '0' return value from 'main' is a C99 extension}} */
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -Wno-strict-prototypes -Wmain-return-type %s
2+
*/
3+
4+
/* expected-no-diagnostics */
5+
6+
void exit(int);
7+
8+
int main() {
9+
if (1)
10+
exit(1);
11+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -Wno-strict-prototypes -Wmain-return-type %s
2+
*/
3+
4+
/* expected-no-diagnostics */
5+
6+
int main() {
7+
return 0;
8+
}

clang/test/Sema/main-no-return-c89.c

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)