PowerPC is lacking tests checking _Atomic alignment in cfe. Adding these tests since we're going to make change to align with gcc on Linux.
Details
- Reviewers
hubert.reinterpretcast jsji xingxue - Group Reviewers
Restricted Project - Commits
- rG9247145fbae7: [PowerPC][NFC] Add atomic alignments and ops tests for powerpc
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/test/CodeGen/PowerPC/atomic-alignment.c | ||
---|---|---|
3–7 | Fix typos: "unkonwn" |
clang/test/CodeGen/PowerPC/atomic-alignment.c | ||
---|---|---|
2 | I am not sure about having a CodeGen test for this when a -fsyntax-only Layout test would do. I believe that also removes the need for powerpc-registered-target. | |
clang/test/Sema/atomic-ops.c | ||
7–8 | Consider testing across the -mcpu=power7 and -mcpu=power8 boundary. |
LGTM with comment (not blocking).
clang/test/CodeGen/PowerPC/atomic-alignment.c | ||
---|---|---|
2 | I will note that there is a concept of "preferred alignment" or "complete object alignment" that may differ from "required alignment". A CodeGen test like this can miss issues if the "required alignment" is wrong but the "preferred alignment" or "complete object alignment" matches what is expected. |
clang/test/CodeGen/PowerPC/atomic-alignment.c | ||
---|---|---|
2 | That's a good point. However currently, I haven't found any tests in test/Sema performing such check and I have't figure out a way to add such check. Maybe checking __alignof__() % (expected_align) == 0 is more practical. |
clang/test/CodeGen/PowerPC/atomic-alignment.c | ||
---|---|---|
2 | There are tests in test/Layout that might be closer. |
I am not sure about having a CodeGen test for this when a -fsyntax-only Layout test would do. I believe that also removes the need for powerpc-registered-target.