aboutsummaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorShahab Vahedi <shahab@synopsys.com>2022-11-27 18:38:24 +0100
committerVineet Gupta <vineet.gupta@linux.dev>2022-11-29 14:33:56 -0800
commit987f8647e8d6206cebc613e5c162ff8b4d014d40 (patch)
tree6ca53f8e72e18c0779826d4cbb3c2671f36a5db4 /support
parent227df6243a2b5b4d70d11772d12c02eb9cb666ca (diff)
downloadglibc-987f8647e8d6206cebc613e5c162ff8b4d014d40.zip
glibc-987f8647e8d6206cebc613e5c162ff8b4d014d40.tar.gz
glibc-987f8647e8d6206cebc613e5c162ff8b4d014d40.tar.bz2
scripts: Add "|" operator support to glibcpp's parsing
From the tests point of view, this is a necessary step for another patch [1] and allows parsing macros such as "#define A | B". Without it, a few tests [2] choke when the other patch [1] is applied: /src/glibc/scripts/../elf/elf.h:4167: error: uninterpretable macro token sequence: ( EF_ARC_MACH_MSK | EF_ARC_OSABI_MSK ) Traceback (most recent call last): File "/src/glibc/elf/tst-glibcelf.py", line 23, in <module> import glibcelf File "/src/glibc/scripts/glibcelf.py", line 226, in <module> _elf_h = _parse_elf_h() ^^^^^^^^^^^^^^ File "/src/glibc/scripts/glibcelf.py", line 223, in _parse_elf_h raise IOError('parse error in elf.h') OSError: parse error in elf.h [1] ARC: update definitions in elf/elf.h https://sourceware.org/pipermail/libc-alpha/2022-November/143503.html [2] tst-glibcelf, tst-relro-ldso, and tst-relro-libc Reviewed-by: Florian Weimer <fweimer@redhat.com> Signed-off-by: Shahab Vahedi <shahab@synopsys.com>
Diffstat (limited to 'support')
-rw-r--r--support/tst-glibcpp.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/support/tst-glibcpp.py b/support/tst-glibcpp.py
index a2db191..cca8bd6 100644
--- a/support/tst-glibcpp.py
+++ b/support/tst-glibcpp.py
@@ -131,6 +131,7 @@ check_macro_eval('#define A 1', {'A': 1})
check_macro_eval('#define A (1)', {'A': 1})
check_macro_eval('#define A (1 + 1)', {'A': 2})
check_macro_eval('#define A (1U << 31)', {'A': 1 << 31})
+check_macro_eval('#define A (1 | 2)', {'A': 1 | 2})
check_macro_eval('''\
#define A (B + 1)
#define B 10