Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions libcxx/test/libcxx/odr_signature.exceptions.sh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
//
//===----------------------------------------------------------------------===//

// TODO: Investigate
// ABI tags have no effect in MSVC mode.
// XFAIL: msvc

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// Test that we encode whether exceptions are supported in an ABI tag to avoid
// ODR violations when linking TUs that have different values for it.

Expand All @@ -18,17 +20,19 @@
// RUN: %{cxx} %t.tu1.o %t.tu2.o %t.main.o %{flags} %{link_flags} -o %t.exe
// RUN: %{exec} %t.exe

#include "test_macros.h"

// -fno-exceptions
#ifdef TU1
# include <__config>
_LIBCPP_HIDE_FROM_ABI inline int f() { return 1; }
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 1; }
int tu1() { return f(); }
#endif // TU1

// -fexceptions
#ifdef TU2
# include <__config>
_LIBCPP_HIDE_FROM_ABI inline int f() { return 2; }
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 2; }
int tu2() { return f(); }
#endif // TU2

Expand Down
14 changes: 9 additions & 5 deletions libcxx/test/libcxx/odr_signature.hardening.sh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
//
//===----------------------------------------------------------------------===//

// TODO: Investigate
// ABI tags have no effect in MSVC mode.
// XFAIL: msvc
Comment on lines +9 to 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably document that we're not providing our per-TU guarantees on MSVC?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should do that somewhere, yes.


// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// Test that we encode the hardening mode in an ABI tag to avoid ODR violations
// when linking TUs that have different values for it.

Expand All @@ -21,31 +23,33 @@
// RUN: %{cxx} %t.tu1.o %t.tu2.o %t.tu3.o %t.tu4.o %t.main.o %{flags} %{link_flags} -o %t.exe
// RUN: %{exec} %t.exe

#include "test_macros.h"

// fast hardening mode
#ifdef TU1
# include <__config>
_LIBCPP_HIDE_FROM_ABI inline int f() { return 1; }
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 1; }
int tu1() { return f(); }
#endif // TU1

// extensive hardening mode
#ifdef TU2
# include <__config>
_LIBCPP_HIDE_FROM_ABI inline int f() { return 2; }
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 2; }
int tu2() { return f(); }
#endif // TU2

// debug hardening mode
#ifdef TU3
# include <__config>
_LIBCPP_HIDE_FROM_ABI inline int f() { return 3; }
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 3; }
int tu3() { return f(); }
#endif // TU3

// No hardening
#ifdef TU4
# include <__config>
_LIBCPP_HIDE_FROM_ABI inline int f() { return 4; }
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 4; }
int tu4() { return f(); }
#endif // TU4

Expand Down
Loading