This is an archive of the discontinued LLVM Phabricator instance.

[NFC][Clang] Modify expect of fail test or XFAIL because CSKY align is different
ClosedPublic

Authored by zixuan-wu on May 4 2022, 9:16 PM.

Details

Summary

CSKY is always in 4-byte align, no matter it's long long type. For global aggregate variable, it's 4-byte align if its size is bigger than or equal to 4 bytes.

Diff Detail

Event Timeline

zixuan-wu created this revision.May 4 2022, 9:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2022, 9:16 PM
zixuan-wu requested review of this revision.May 4 2022, 9:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2022, 9:16 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
zixuan-wu edited the summary of this revision. (Show Details)May 4 2022, 9:17 PM
rengolin added inline comments.May 6 2022, 4:42 AM
clang/test/Sema/builtin-alloca-with-align.c
32

This test is platform agnostic, perhaps the extra error could be in a new test, exclusively for csky?

zixuan-wu added inline comments.May 6 2022, 7:29 PM
clang/test/Sema/builtin-alloca-with-align.c
32

Then I prefer to split the file and add UNSUPPORTED for CSKY in the other file which only contains test8

rengolin added inline comments.May 7 2022, 6:20 AM
clang/test/Sema/builtin-alloca-with-align.c
32

But then you wouldn't be testing the extra error you want... hmm.

Maybe it would be fine the way you did it originally.

Would be nice to get a clang person to give their opinion.

Could anybody else have a review or nominate a reviewer?

aaron.ballman added inline comments.May 9 2022, 6:28 AM
clang/test/Sema/builtin-alloca-with-align.c
32
// Comment which explains why this is special.

I think I would test this slightly differently:

void test8(void) {
  __builtin_alloca_with_align(sizeof(__INT64_TYPE__), __alignof__(__INT64_TYPE__)); // expected-warning {{second argument to __builtin_alloca_with_align is supposed to be in bits}}
#ifdef __csky__
  // expected-error@-2 {{requested alignment must be 8 or greater}}
  // Comment which explains why this is special.
#endif // __csky__
}
zixuan-wu added inline comments.May 11 2022, 1:48 AM
clang/test/Sema/builtin-alloca-with-align.c
32

Reusing the first warning is good.

zixuan-wu updated this revision to Diff 428585.May 11 2022, 1:52 AM

Address comments.

This revision is now accepted and ready to land.May 17 2022, 4:13 AM