[PATCH] D85612: [Sema] Use proper integral cast for an enumerate with a fixed bool type
Mark de Wever via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 10 12:37:49 PDT 2020
Mordante marked 3 inline comments as done.
Mordante added inline comments.
================
Comment at: clang/test/AST/ast-dump-enum-bool.cpp:1
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -ast-dump=json %s | FileCheck %s
+
----------------
rsmith wrote:
> aaron.ballman wrote:
> > riccibruno wrote:
> > > Why a (pretty unreadable) json test? There is also `make-ast-dump-check.sh` to auto-generate an ast dump test.
> > I'd also like to see some CodeGen tests for various fixed underlying types that ensures the conversion to the underlying type happens before the conversion to the enumeration.
> >
> > Also, at least one test showing this behaves properly with a C-style cast instead of a named cast.
> In addition to CodeGen tests, we should also test that constant evaluation does the right thing.
@riccibruno Thanks for the hint! I wasn't aware of this tool. I've modified the AST test.
@aaron.ballman I've added a C-style AST test and CodeGen tests. However I'm not sure what you expect to see in the CodeGen tests. As I expected the CodeGen doesn't know about the enum, but it just uses the underlying type of the enum. Please let me know if you want to see additional tests.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85612/new/
https://reviews.llvm.org/D85612
More information about the cfe-commits
mailing list