This is regression test for https://github.com/llvm/llvm-project/issues/44994
Details
Diff Detail
- Repository
- rT test-suite
- Build Status
Buildable 185184 Build 279433: arc lint + arc unit
Event Timeline
SingleSource/Regression/C/issue44994-1.c | ||
---|---|---|
43 | I'm not sure I understand why we need to use a union and manually care about endianess. unsigned _BitInt(256) a = 6; unsigned _BitInt(256) b = 3; unsigned _BitInt(256) q = a / b; unsigned _BitInt(256) expected = 2; if(q != expected) return 1; should work fine on little and big endian machines. Another thing to look out for is that those tests are not fully optimized to constants, and then there is no div left for the backend. |
SingleSource/Regression/C/issue44994-1.c | ||
---|---|---|
43 |
It's only because I don't have a better way to initialize _BitInt(256) (e.g. 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF). Do you know a better way?
According to the main_dump I generated with O2, I think the ExpandLargeDiv Pass is working. And I can find %div = udiv i256 %0, %1 in IR generated under O2. |
SingleSource/Regression/C/issue44994-1.c | ||
---|---|---|
43 | Maybe using the literal suffixes would work, see clang/test/Lexer/bitint-constants.c? |
I'm not sure I understand why we need to use a union and manually care about endianess.
I'm thinking that writing
should work fine on little and big endian machines.
Another thing to look out for is that those tests are not fully optimized to constants, and then there is no div left for the backend.
I guess we can either use -O0, or add some dependency on argc or similar.