[PATCH] D99614: [flang] Update list-input test to use GTest

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 13 03:00:30 PDT 2021


awarzynski accepted this revision.
awarzynski added a comment.
This revision is now accepted and ready to land.

In D99614#2683137 <https://reviews.llvm.org/D99614#2683137>, @ashermancinelli wrote:

> I typically use `static` to reduce the number of initializations

I was under the false impression that `constexpr` effectively implied `static` in this context. I couldn't find a good reference, but here's a small experiment on compiler explorer that demonstrates that `constexpr` and `static constexpr` are indeed different: https://godbolt.org/z/9qh16zeGc (adding `static` makes `a` a compile-time constant). There's no difference when compiling with optimisations enabled (e.g.`-O1`). Apologies for the confusion.

@klausler , do you prefer `static` to be restored here? I'm fine with this patch either way so accepting as is.

@ashermancinelli LGTM, thank you for working on this! Could you add missing newline characters before merging?



================
Comment at: flang/unittests/RuntimeGTest/ListInputTest.cpp:65
+    ASSERT_EQ(std::strcmp(outputBuffers[j], expectedOutput), 0)
+        << "wanted outputBuffers[" << j << "]=" << expectedOutput << ", got '"
+        << outputBuffers[j] << "'\n";
----------------
ashermancinelli wrote:
> awarzynski wrote:
> > Probably `expectedOutput`?
> Could you elaborate? I'm not sure I understand.
I'm re-rereading this now and see what you meant. Makes sense!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99614



More information about the llvm-commits mailing list