[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

David Spickett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 17 02:01:30 PDT 2022


DavidSpickett added inline comments.


================
Comment at: clang/test/CodeGen/const-init.c:2
+// setting strict FP behaviour in the run line below tests that the compiler
+// does the right thing for global compound literals (compoundliteral test)
+// RUN: %clang_cc1 -no-opaque-pointers -triple i386-pc-linux-gnu -ffreestanding -Wno-pointer-to-int-cast -Wno-int-conversion -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s
----------------
Drive by comment, what is "the right thing" here? Without me having to git blame this file if I'm looking at this months from now.

You could add a comment down next to the test like "clang should evaluate this in a constant context, so floating point mode should have no effect". Which is still a bit vague but better than "clang should not crash if we do this".

Also are there any other floating point modes that have/had this same problem? They should be tested too if so.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131555



More information about the cfe-commits mailing list