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:
Stephen Heumann committed 2026-04-02 18:04:38 -05:00
1 parent 99bc1d5534
commit 2ee05a2ff7
3 files changed
+18

No files matched your search

+11
View File
@@ -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
+2
View File
@@ -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;
+5
View File
@@ -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;