2013-07-14 10:01:48 +08:00
|
|
|
// RUN: rm -rf %t
|
|
|
|
// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++11
|
2014-06-17 04:26:19 +08:00
|
|
|
// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -ast-dump -ast-dump-filter merge -std=c++11 | FileCheck %s
|
2013-07-14 10:01:48 +08:00
|
|
|
|
|
|
|
// expected-no-diagnostics
|
|
|
|
|
2014-05-16 10:14:42 +08:00
|
|
|
void use_implicit_new() { operator new[](3); }
|
|
|
|
|
2013-08-30 08:23:29 +08:00
|
|
|
@import dummy;
|
2013-07-14 10:01:48 +08:00
|
|
|
@import cxx_decls.imported;
|
|
|
|
|
|
|
|
void test_delete(int *p) {
|
|
|
|
// We can call the normal global deallocation function even though it has only
|
|
|
|
// ever been explicitly declared in an unimported submodule.
|
|
|
|
delete p;
|
|
|
|
}
|
2013-08-30 08:23:29 +08:00
|
|
|
|
|
|
|
void friend_1(HasFriends s) {
|
|
|
|
s.private_thing();
|
|
|
|
}
|
|
|
|
void test_friends(HasFriends s) {
|
|
|
|
friend_1(s);
|
|
|
|
friend_2(s);
|
|
|
|
}
|
2014-04-18 04:33:01 +08:00
|
|
|
|
|
|
|
static_assert(!__is_trivial(HasNontrivialDefaultConstructor), "");
|
|
|
|
static_assert(!__has_trivial_constructor(HasNontrivialDefaultConstructor), "");
|
2014-05-16 10:14:42 +08:00
|
|
|
|
|
|
|
void use_implicit_new_again() { operator new[](3); }
|
2014-06-17 04:26:19 +08:00
|
|
|
|
|
|
|
int importMergeUsedFlag = getMergeUsedFlag();
|
|
|
|
|
2014-08-23 09:45:27 +08:00
|
|
|
int use_name_for_linkage(NameForLinkage &nfl) {
|
|
|
|
return nfl.n + nfl.m;
|
|
|
|
}
|
2014-08-27 07:29:11 +08:00
|
|
|
int use_overrides_virtual_functions(OverridesVirtualFunctions ovf) { return 0; }
|
2014-08-23 09:45:27 +08:00
|
|
|
|
2014-06-17 04:26:19 +08:00
|
|
|
@import cxx_decls_merged;
|
|
|
|
|
2014-08-30 08:04:23 +08:00
|
|
|
NameForLinkage2Inner use_name_for_linkage2_inner;
|
|
|
|
NameForLinkage2 use_name_for_linkage2;
|
|
|
|
|
2014-08-23 09:45:27 +08:00
|
|
|
int name_for_linkage_test = use_name_for_linkage(name_for_linkage);
|
2014-08-27 07:29:11 +08:00
|
|
|
int overrides_virtual_functions_test =
|
|
|
|
use_overrides_virtual_functions(overrides_virtual_functions);
|
2014-08-23 09:45:27 +08:00
|
|
|
|
2014-08-30 06:33:38 +08:00
|
|
|
void use_extern_c_function() { ExternCFunction(); }
|
|
|
|
|
2014-09-04 07:11:22 +08:00
|
|
|
int use_namespace_alias() { return Alias::a + Alias::b; }
|
|
|
|
|
2014-08-30 06:33:38 +08:00
|
|
|
@import cxx_decls_premerged;
|
|
|
|
|
|
|
|
void use_extern_c_function_2() { ExternCFunction(); }
|
|
|
|
|
2015-02-27 09:57:00 +08:00
|
|
|
InhCtorB inhctorb(2);
|
|
|
|
|
2014-06-17 04:26:19 +08:00
|
|
|
// CHECK: VarDecl [[mergeUsedFlag:0x[0-9a-f]*]] {{.*}} in cxx_decls.imported used mergeUsedFlag
|
|
|
|
// CHECK: VarDecl {{0x[0-9a-f]*}} prev [[mergeUsedFlag]] {{.*}} in cxx_decls_merged used mergeUsedFlag
|