[all-commits] [llvm/llvm-project] c3efe7: [libcxx] [test] Fix odr_signature tests with optim...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Wed Jun 18 04:12:35 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c3efe7d64cebcd8679bec3ba7ff8154f8b0a1fa4
      https://github.com/llvm/llvm-project/commit/c3efe7d64cebcd8679bec3ba7ff8154f8b0a1fa4
  Author: Martin Storsjö <martin at martin.st>
  Date:   2025-06-18 (Wed, 18 Jun 2025)

  Changed paths:
    M libcxx/test/libcxx/odr_signature.exceptions.sh.cpp
    M libcxx/test/libcxx/odr_signature.hardening.sh.cpp

  Log Message:
  -----------
  [libcxx] [test] Fix odr_signature tests with optimizations enabled (#144317)

If optimization is enabled, the inline `f()` function actually gets
inlined, meaning that the functions `tu1()` and `tu2()` trivially return
1 and 2, instead of actually referencing the potentially linker
deduplicated function `f()`, which is what the test tries to test.

Therefore, this test previously actually failed to test what it was
supposed to test, if optimization was enabled.

Mark the inline functions with `TEST_NOINLINE` to make sure that they
don't get inlined even with optimizations enabled.

Also update the TODO comments to explain why we have an XFAIL for msvc
mode here.

This avoids these tests unexpectedly passing if building in msvc mode,
with optimizations enabled
(`-DLIBCXX_TEST_PARAMS="optimization=speed"`).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list