1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 // Test that we encode whether exceptions are supported in an ABI tag to avoid
13 // ODR violations when linking TUs that have different values for it.
15 // RUN: %{cxx} %s %{flags} %{compile_flags} -c -DTU1 -fno-exceptions -o %t.tu1.o
16 // RUN: %{cxx} %s %{flags} %{compile_flags} -c -DTU2 -fexceptions -o %t.tu2.o
17 // RUN: %{cxx} %s %{flags} %{compile_flags} -c -DMAIN -o %t.main.o
18 // RUN: %{cxx} %t.tu1.o %t.tu2.o %t.main.o %{flags} %{link_flags} -o %t.exe
19 // RUN: %{exec} %t.exe
24 _LIBCPP_HIDE_FROM_ABI inline int f() { return 1; }
25 int tu1() { return f(); }
31 _LIBCPP_HIDE_FROM_ABI inline int f() { return 2; }
32 int tu2() { return f(); }
41 int main(int, char**) {