mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 19:55:48 +01:00
Ensure exported entities aren't remapped/duplicated (#7304)
This ensures the clang_decls map is used as a cache - without this, visiting the same entity twice could cause it to be re-exported/duplicated. See attached test case.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/export/alias.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/export/alias.carbon
|
||||
|
||||
// --- alias_identical_address.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
fn F();
|
||||
alias G = F;
|
||||
|
||||
inline Cpp '''
|
||||
static_assert(&Carbon::F == &Carbon::G);
|
||||
''';
|
||||
Reference in New Issue
Block a user