[PATCH] D127201: [clang] Add tests for statement expression in initializers

Anders Waldenborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 13 08:47:25 PDT 2022


wanders added a comment.

In D127201#3578077 <https://reviews.llvm.org/D127201#3578077>, @aaron.ballman wrote:

> Thanks for adding some more test coverage! Would it be worth mentioning the miscompile fix in the release notes more explicitly?

Yes, might be a good idea, in particualar as some cases which were accepted (but miscompiled) now gives compilation errors.

Will add something to release notes.



================
Comment at: clang/test/CodeGen/stmtexpr-init.c:1
+// RUN: %clang_cc1 -O -std=gnu11 %s -emit-llvm -o - | FileCheck %s
+
----------------
erichkeane wrote:
> why the -std=gnu11 here?  I would assume our default would be enough?  Also, why the opt-flag?  That likely is unnecessary/will cause 'bad things' to happen.  Clang tests typically don't use the opt flags.
> why the -std=gnu11 here?  I would assume our default would be enough?  Also, why the opt-flag?  That likely is unnecessary/will cause 'bad things' to happen.  Clang tests typically don't use the opt flags.

Right, gnu11 shouldn't be needed.

The -O flag was there as that made the optimizer remove some of the dynamic initialization things making it easier to see the pattern to match on. But I see now that the checks I ended up doing matches just fine without it.

So will drop these. Thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127201



More information about the cfe-commits mailing list