[libcxx-commits] [PATCH] D146294: [libcxx] Fix crash in std::stringstream with payload >= INT_MAX
Azat Khuzhin via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun May 7 11:10:06 PDT 2023
azat added inline comments.
================
Comment at: libcxx/test/std/input.output/string.streams/stringstream.members/gcount.pass.cpp:19
+int main(int, char**) {
+#if __SIZE_WIDTH__ == 64
+ std::stringstream ss;
----------------
Mordante wrote:
> Why is this needed? Can't you just compare that an int is 32-bit?
>
> I ideally I would rather make the test unsupported on platform that are not used. Otherwise this test gives a false sense of doing something.
>
> Maybe we should add a feature in `libcxx/utils/libcxx/test/features.py` Something like `can-test-gcount` Then we only enable it on 64-bit platforms where int is a 32-bit value. WDYT?
Yeah, I did not like it either, but that was simpler.
I don't think that introducing special flag only for one test will be a good choice however.
What do you think about something like this instead:
```
// UNSUPPORTED: target={{.*}}32{{.*}}
```
But this will not work for some arches (not sure that they are added to CI), i.e. `x86`.
So instead I could add a separate parameter `libcxx/utils/libcxx/test/params.py` something like `size_t_bytes`, although I'm not sure is there an easy way to extract this in python, maybe you have an idea?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146294/new/
https://reviews.llvm.org/D146294
More information about the libcxx-commits
mailing list