2 // RUN: %clang_cc1 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++11
3 // RUN: %clang_cc1 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -ast-dump -ast-dump-filter merge -std=c++11 | FileCheck %s
5 // expected-no-diagnostics
7 void use_implicit_new() { operator new[](3); }
10 @import cxx_decls
.imported
;
12 void test_delete(int *p
) {
13 // We can call the normal global deallocation function even though it has only
14 // ever been explicitly declared in an unimported submodule.
18 void friend_1(HasFriends s
) {
21 void test_friends(HasFriends s
) {
26 static_assert(!__is_trivial(HasNontrivialDefaultConstructor
), "");
27 static_assert(!__has_trivial_constructor(HasNontrivialDefaultConstructor
), "");
29 void use_implicit_new_again() { operator new[](3); }
31 int importMergeUsedFlag
= getMergeUsedFlag();
33 int use_name_for_linkage(NameForLinkage
&nfl
) {
36 int use_overrides_virtual_functions(OverridesVirtualFunctions ovf
) { return 0; }
38 @import cxx_decls_merged
;
40 NameForLinkage2Inner use_name_for_linkage2_inner
;
41 NameForLinkage2 use_name_for_linkage2
;
43 int name_for_linkage_test
= use_name_for_linkage(name_for_linkage
);
44 int overrides_virtual_functions_test
=
45 use_overrides_virtual_functions(overrides_virtual_functions
);
47 void use_extern_c_function() { ExternCFunction(); }
49 int use_namespace_alias() { return Alias::a
+ Alias::b
; }
51 @import cxx_decls_premerged
;
53 void use_extern_c_function_2() { ExternCFunction(); }
57 // CHECK: VarDecl [[mergeUsedFlag:0x[0-9a-f]*]] {{.*}} in cxx_decls.imported used mergeUsedFlag
58 // CHECK: VarDecl {{0x[0-9a-f]*}} prev [[mergeUsedFlag]] {{.*}} in cxx_decls_merged used mergeUsedFlag