mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2026-04-26 21:18:08 +00:00
Update tests to avoid using trigraphs in C23 mode.
In C23 mode, C2.1.0.4.CC now tests that the former trigraph sequences are treated as regular characters (not trigraphs) in strings.
This commit is contained in:
1 parent
99bc1d5534
commit
2ee05a2ff7
3 files changed
+18
No files matched your search
@@ -4,6 +4,8 @@
|
||||
|
||||
int printf(const char *, ...);
|
||||
|
||||
#if __STDC_VERSION__ < 202311L
|
||||
|
||||
??=define ten 10 /* ??= is '#' */
|
||||
|
||||
int main (void)
|
||||
@@ -43,3 +45,12 @@ int main (void)
|
||||
Fail:
|
||||
printf ("Failed Conformance Test 2.1.0.2\n");
|
||||
??> /* ??> is '}' */
|
||||
|
||||
#else
|
||||
|
||||
int main (void)
|
||||
{
|
||||
printf ("Passed Conformance Test 2.1.0.2\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -7,6 +7,7 @@ int main (void)
|
||||
{
|
||||
char a;
|
||||
|
||||
#if __STDC_VERSION__ < 202311L
|
||||
a = '??='; /* ??= is '#' */
|
||||
if (a != '#')
|
||||
goto Fail;
|
||||
@@ -42,6 +43,7 @@ int main (void)
|
||||
a = '??>'; /* ??> is '}' */
|
||||
if (a != '}')
|
||||
goto Fail;
|
||||
#endif
|
||||
|
||||
printf ("Passed Conformance Test 2.1.0.3\n");
|
||||
return 0;
|
||||
|
||||
@@ -9,8 +9,13 @@ int main (void)
|
||||
{
|
||||
char a [] = "??=??/boh??'??!??-??(??<??)??>boy";
|
||||
|
||||
#if __STDC_VERSION__ < 202311L
|
||||
if ((strcmp (a, "#\boh^|~[{]}boy")) != 0)
|
||||
goto Fail;
|
||||
#else
|
||||
if ((strcmp (a, "?" "?=?" "?/boh?" "?'?" "?!?" "?-?" "?(?" "?<?" "?)?" "?>boy")) != 0)
|
||||
goto Fail;
|
||||
#endif
|
||||
|
||||
printf ("Passed Conformance Test 2.1.0.4\n");
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user