2017-10-21 23:40:19 +00:00
|
|
|
/* Conformance Test 2.1.0.2: Verification of ANSI C trigraphs */
|
|
|
|
|
2022-10-17 22:50:42 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
int printf(const char *, ...);
|
|
|
|
|
2017-10-21 23:40:19 +00:00
|
|
|
??=define ten 10 /* ??= is '#' */
|
|
|
|
|
2022-10-17 22:50:42 +00:00
|
|
|
int main (void)
|
2017-10-21 23:40:19 +00:00
|
|
|
??< /* ??< is '{' */
|
|
|
|
int i;
|
|
|
|
char a, b??(10??) = "abc"; /* ??( is '[' */
|
|
|
|
/* ??) is ']' */
|
|
|
|
|
|
|
|
if (ten != 10)
|
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
if ((strcmp (b, "abc")) != 0)
|
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
a = '??/n'; /* ??/ is '\' */
|
|
|
|
if (a != 0x0A)
|
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
i = 5 ??/
|
|
|
|
* 8;
|
|
|
|
|
|
|
|
i = 0x7F ??' 0x03; /* ??' is '^', XOR */
|
|
|
|
if (i != 0x7C)
|
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
i = 0x45 ??! 0x03; /* ??! is '|', OR */
|
|
|
|
if (i != 0x47)
|
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
i = ??-i; /* ??- is '~', bitwise negation */
|
|
|
|
if (i != 0xFFB8)
|
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
printf ("Passed Conformance Test 2.1.0.2\n");
|
2022-10-17 22:50:42 +00:00
|
|
|
return 0;
|
2017-10-21 23:40:19 +00:00
|
|
|
|
|
|
|
Fail:
|
|
|
|
printf ("Failed Conformance Test 2.1.0.2\n");
|
|
|
|
??> /* ??> is '}' */
|