| 1 |
// RUN: rm -rf %t |
| 2 |
// RUN: %clang_cc1 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Wno-deprecated-builtins -I %S/Inputs %s -verify -std=c++11 |
| 3 |
// RUN: %clang_cc1 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Wno-deprecated-builtins -I %S/Inputs %s -ast-dump -ast-dump-filter merge -std=c++11 | FileCheck %s |
| 4 |
|
| 5 |
// expected-no-diagnostics |
| 6 |
|
| 7 |
void use_implicit_new() { operator new[](3); } |
| 8 |
|
| 9 |
@import dummy; |
| 10 |
@import cxx_decls.imported; |
| 11 |
|
| 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. |
| 15 |
delete p; |
| 16 |
} |
| 17 |
|
| 18 |
void friend_1(HasFriends s) { |
| 19 |
s.private_thing(); |
| 20 |
} |
| 21 |
void test_friends(HasFriends s) { |
| 22 |
friend_1(s); |
| 23 |
friend_2(s); |
| 24 |
} |
| 25 |
|
| 26 |
static_assert(!__is_trivial(HasNontrivialDefaultConstructor), ""); |
| 27 |
static_assert(!__has_trivial_constructor(HasNontrivialDefaultConstructor), ""); |
| 28 |
|
| 29 |
void use_implicit_new_again() { operator new[](3); } |
| 30 |
|
| 31 |
int importMergeUsedFlag = getMergeUsedFlag(); |
| 32 |
|
| 33 |
int use_name_for_linkage(NameForLinkage &nfl) { |
| 34 |
return nfl.n + nfl.m; |
| 35 |
} |
| 36 |
int use_overrides_virtual_functions(OverridesVirtualFunctions ovf) { return 0; } |
| 37 |
|
| 38 |
@import cxx_decls_merged; |
| 39 |
|
| 40 |
NameForLinkage2Inner use_name_for_linkage2_inner; |
| 41 |
NameForLinkage2 use_name_for_linkage2; |
| 42 |
|
| 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); |
| 46 |
|
| 47 |
void use_extern_c_function() { ExternCFunction(); } |
| 48 |
|
| 49 |
int use_namespace_alias() { return Alias::a + Alias::b; } |
| 50 |
|
| 51 |
@import cxx_decls_premerged; |
| 52 |
|
| 53 |
void use_extern_c_function_2() { ExternCFunction(); } |
| 54 |
|
| 55 |
InhCtorB inhctorb(2); |
| 56 |
|
| 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 |