mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-16 05:33:25 +00:00
Add a specific test for old C89 features that were removed from C99+.
This commit is contained in:
parent
afe40c0f67
commit
b3c30b05d8
@ -1,3 +1,4 @@
|
||||
{1} c89oldfeat.c
|
||||
{1} c95digraph.c
|
||||
{1} c95iso646.c
|
||||
{1} c99fam.c
|
||||
|
31
Tests/Conformance/c89oldfeat.c
Normal file
31
Tests/Conformance/c89oldfeat.c
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Test old features from C89/C90 that have been removed or deprecated in C99+.
|
||||
*/
|
||||
|
||||
int printf(const char *, ...);
|
||||
|
||||
#define M+4 /* no whitespace after macro name */
|
||||
|
||||
main () /* implicit int, no prototypes */
|
||||
{
|
||||
auto i,j; /* implicit int */
|
||||
|
||||
j = M;
|
||||
i = (const) j; /* implicit int */
|
||||
i = (volatile) j;
|
||||
|
||||
if (f(i) == 8) /* calling undeclared function */
|
||||
{
|
||||
printf ("Passed Conformance Test c89oldfeat\n");
|
||||
return 0;
|
||||
};
|
||||
|
||||
printf ("Failed Conformance Test c89oldfeat\n");
|
||||
return; /* return no value from a function returning int */
|
||||
}
|
||||
|
||||
f(x) /* implicit int, no prototypes */
|
||||
/* implicit int parameter x */
|
||||
{
|
||||
return x * 2;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user