diff --git a/test/standalone/config_header/autoconf_at/autoconf_at.txt b/test/standalone/config_header/autoconf_at/autoconf_at.txt index fccd1255f887c410c0f86a87d51e531685a4382b..e35cb5f822ab889e727d0fd13fe263fedb8b24cd 100644 --- a/test/standalone/config_header/autoconf_at/autoconf_at.txt +++ b/test/standalone/config_header/autoconf_at/autoconf_at.txt @@ -35,3 +35,15 @@ what is 6*7? 42! @text@ // expanded variables are considered strings after expansion @string@ + +// variable name with underscores +value + +// backslash before at-sigil does not prevent resolution +\text + +// value that is an at-sign itself +@ + +// incomplete key mid-line is preserved, trailing content kept +@incomplete trailing content diff --git a/test/standalone/config_header/autoconf_at/autoconf_at.txt.in b/test/standalone/config_header/autoconf_at/autoconf_at.txt.in index 8dfbab96d7b4483305352787cc32e420f606f0db..77d15622e8223e3e51ccc66889deb2b0d79b563b 100644 --- a/test/standalone/config_header/autoconf_at/autoconf_at.txt.in +++ b/test/standalone/config_header/autoconf_at/autoconf_at.txt.in @@ -34,3 +34,15 @@ what is 6*7? @integer@! @@string@@ // expanded variables are considered strings after expansion @string_at@ + +// variable name with underscores +@underscored_var@ + +// backslash before at-sigil does not prevent resolution +\@string@ + +// value that is an at-sign itself +@at_sign@ + +// incomplete key mid-line is preserved, trailing content kept +@incomplete trailing content diff --git a/test/standalone/config_header/autoconf_undef/config.h b/test/standalone/config_header/autoconf_undef/config.h index ef5b4abab30499feb5c82019ae8750e82b059512..3a649b0aca5576d75099906310d28ef049d50f4a 100644 --- a/test/standalone/config_header/autoconf_undef/config.h +++ b/test/standalone/config_header/autoconf_undef/config.h @@ -20,4 +20,15 @@ int foo(); /* #undef PREFIX_TAB */ /* #undef POSTFIX_SPACE */ /* #undef POSTFIX_TAB */ + +// #undef with underscored variable name +#define SOME_UNDERSCORED 1 + +// #undef with extra tokens after variable name (ignored) +#define SOME_ONE 1 + +// non-#undef # lines pass through unchanged +#define KEPT_DEFINE value +#include // TODO: unexpected newline is being added here + diff --git a/test/standalone/config_header/autoconf_undef/config.h.in b/test/standalone/config_header/autoconf_undef/config.h.in index fafc3587658162eaae0c918320df9752b779086d..1a13ccf319a85432ff04916ac0145b23bf78a7d3 100644 --- a/test/standalone/config_header/autoconf_undef/config.h.in +++ b/test/standalone/config_header/autoconf_undef/config.h.in @@ -17,6 +17,16 @@ int foo(); #undef PREFIX_SPACE #undef PREFIX_TAB -#undef POSTFIX_SPACE -#undef POSTFIX_TAB -// TODO: unexpected newline is being added here \ No newline at end of file +#undef POSTFIX_SPACE +#undef POSTFIX_TAB + +// #undef with underscored variable name +#undef SOME_UNDERSCORED + +// #undef with extra tokens after variable name (ignored) +#undef SOME_ONE extra ignored tokens + +// non-#undef # lines pass through unchanged +#define KEPT_DEFINE value +#include +// TODO: unexpected newline is being added here diff --git a/test/standalone/config_header/build.zig b/test/standalone/config_header/build.zig index e6d62557e223abb8e610cc945986ee82165fe14f..42080a0996c2b330a73ff5ad721be8a3d120e15b 100644 --- a/test/standalone/config_header/build.zig +++ b/test/standalone/config_header/build.zig @@ -21,6 +21,8 @@ pub fn build(b: *std.Build) void { .PREFIX_TAB = null, .POSTFIX_SPACE = null, .POSTFIX_TAB = null, + + .SOME_UNDERSCORED = true, }, ); const check_config_header = b.addCheckFile(config_header.getOutputFile(), .{ @@ -37,6 +39,9 @@ pub fn build(b: *std.Build) void { .integer = 42, .string = "text", .string_at = "@string@", + + .underscored_var = "value", + .at_sign = "@", }, ); const check_config_header_autoconf_at = b.addCheckFile(config_header_autoconf_at.getOutputFile(), .{