[PATCH] D121441: [PowerPC][NFC] Add atomic alignments and ops tests for powerpc

Kai Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 17 22:21:50 PDT 2022


lkail added inline comments.


================
Comment at: clang/test/CodeGen/PowerPC/atomic-alignment.c:1
+// REQUIRES: powerpc-registered-target
+// RUN: %clang_cc1 -verify -triple powerpc-unkonwn-unknown -emit-llvm -o - %s | \
----------------
hubert.reinterpretcast wrote:
> hubert.reinterpretcast wrote:
> > 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`.
> 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.
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121441/new/

https://reviews.llvm.org/D121441



More information about the cfe-commits mailing list