diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2019-09-25 20:25:06 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2019-09-26 11:52:22 +0200 |
| commit | 720ce88a839cc9966d4b5dfbcdbe868c33cb5965 (patch) | |
| tree | 501e70c5a3a21c48dec091832971fde91d666b64 /testsuite.py | |
| parent | f2ce282eca6537210d83f9f0d2c753c2b280943c (diff) | |
Fix handling of parentheses in macro argument values
As an oversight, there was no check for nested parentheses in macro
arguments, making the preprocessor think the call ended after 'void)' in
def_bool $(success,echo 'void foo(void) { asm inline (""); }' | $(CC) -x c - -c -o /dev/null)
This broke the latest linux-next kernels, starting with commit
eb111869301e1 ("compiler-types.h: add asm_inline definition").
I remember seeing this when going through the C code, but somehow forgot
to put it in. Fix it, and clean up _expand_macro() a bit at the same
time.
Fixes: #76
Diffstat (limited to 'testsuite.py')
| -rw-r--r-- | testsuite.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/testsuite.py b/testsuite.py index 93e85d6..a29f815 100644 --- a/testsuite.py +++ b/testsuite.py @@ -2478,8 +2478,8 @@ config J verify_variable("immediate", "foofoo", "foofoo", False) verify_variable("messy-fn-res", - "$($(fn-indir)-unused-arg, a b , c d )", - 'surround-rev-quote " c d " " a b " surround-rev-quote ', + "$($(fn-indir)-unused-arg, a b (,) , c d )", + 'surround-rev-quote " c d " " a b (,) " surround-rev-quote ', True) verify_variable("special-chars-fn-res", @@ -2516,7 +2516,7 @@ config PRINT_ME_TOO verify_repr( "messy-fn-res", - "<variable messy-fn-res, recursive, value '$($(fn-indir)-unused-arg, a b , c d )'>") + "<variable messy-fn-res, recursive, value '$($(fn-indir)-unused-arg, a b (,) , c d )'>") def verify_recursive(name): try: @@ -2546,9 +2546,14 @@ config PRINT_ME_TOO verify_variable("shell-stderr-res", "", "", False) + verify_variable("parens-res", + "pre-$(shell,echo '(a,b,(c,d),e)')-post", + "pre-(a,b,(c,d),e)-post", + True) + verify_variable("location-res", - "Kconfiglib/tests/Kpreprocess:125", - "Kconfiglib/tests/Kpreprocess:125", + "Kconfiglib/tests/Kpreprocess:129", + "Kconfiglib/tests/Kpreprocess:129", False) verify_variable("warning-res", "", "", False) @@ -2568,7 +2573,7 @@ config PRINT_ME_TOO # Check that the expected warnings were generated verify_equal(c.warnings, [ "Kconfiglib/tests/Kpreprocess:122: warning: 'echo message on stderr >&2' wrote to stderr: message on stderr", - "Kconfiglib/tests/Kpreprocess:130: warning: a warning" + "Kconfiglib/tests/Kpreprocess:134: warning: a warning" ]) |
