ORCA-C/Tests/Conformance/c95iso646.c
Stephen Heumann 6ead1d4caf Add a set of new tests for C95/C99/C11 features that we now support.
These are currently only run by the new DOIT3 test-running script.

Note that these tests are designed to be applicable to most implementations of C95/C99/C11, not just ORCA/C. They do make certain assumptions not guaranteed by the standards (e.g. power of 2 types and some properties of IEEE-like FP), but in general those assumptions should be true for most 'normal' systems.
2021-08-22 17:32:56 -05:00

33 lines
635 B
C

/*
* Test support for <iso646.h> (C95).
*/
#include <stdio.h>
#include <iso646.h>
int main(void) {
unsigned int u = 0x000F;
if (not ((0 or 1) and 1))
goto Fail;
u = compl u;
u and_eq 0x056E;
u or_eq 0x4000;
u xor_eq 0x000C;
if (u not_eq 0x456C)
goto Fail;
u = ((0x3000 bitand 0x1400) bitor 0x0020) xor 0x0320;
if (u not_eq 0x1300)
goto Fail;
printf ("Passed Conformance Test c95iso646\n");
return 0;
Fail:
printf ("Failed Conformance Test c95iso646\n");
}