[all-commits] [llvm/llvm-project] 3d94a2: [libc] Fix multiply-defined global functions in ct...

Roland McGrath via All-commits all-commits at lists.llvm.org
Mon Dec 9 11:18:23 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3d94a202302d808db49646c60601e75fdcc40c14
      https://github.com/llvm/llvm-project/commit/3d94a202302d808db49646c60601e75fdcc40c14
  Author: Roland McGrath <mcgrathr at google.com>
  Date:   2024-12-09 (Mon, 09 Dec 2024)

  Changed paths:
    M libc/test/src/ctype/isalnum_test.cpp
    M libc/test/src/ctype/isalpha_test.cpp
    M libc/test/src/ctype/isdigit_test.cpp
    M libc/test/src/ctype/islower_test.cpp
    M libc/test/src/ctype/isupper_test.cpp
    M libc/test/src/ctype/isxdigit_test.cpp
    M libc/test/src/ctype/tolower_test.cpp
    M libc/test/src/ctype/toupper_test.cpp

  Log Message:
  -----------
  [libc] Fix multiply-defined global functions in ctype tests (#119055)

For whatever reason, each ctype test contains its own copy of
some identical helper source code.  These local helpers were
defined with external linkage for no apparent reason.  This leads
to multiple definition errors when linking these tests together.

This change moves each file's local helper code into an anonymous
namespace so it has internal linkage.  It's notable that the libc
test code does not follow the most common norm of gtest-style
code where all the `TEST(...)` cases themselves are defined
inside an anonymous namespace (along with whatever other local
helpers they use); whether libc's tests should follow that usual
convention can be addressed holistically in future discussion.

The replacement of numerous cut&paste'd copies of identical
helper code with sharing the source code in some usual fashion is
also left for later cleanup.

This change only makes the test code not straightforwardly have
multiple definition errors that prevent linking a test executable
at all.



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