Richard Smith | ace21ba | 2013-07-14 02:01:48 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | // RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++11 |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 3 | // 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 |
Richard Smith | ace21ba | 2013-07-14 02:01:48 +0000 | [diff] [blame] | 4 | |
| 5 | // expected-no-diagnostics |
| 6 | |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 7 | void use_implicit_new() { operator new[](3); } |
| 8 | |
Richard Smith | 868edfa | 2013-08-30 00:23:29 +0000 | [diff] [blame] | 9 | @import dummy; |
Richard Smith | ace21ba | 2013-07-14 02:01:48 +0000 | [diff] [blame] | 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 | } |
Richard Smith | 868edfa | 2013-08-30 00:23:29 +0000 | [diff] [blame] | 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 | } |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 25 | |
| 26 | static_assert(!__is_trivial(HasNontrivialDefaultConstructor), ""); |
| 27 | static_assert(!__has_trivial_constructor(HasNontrivialDefaultConstructor), ""); |
| 28 | |
| 29 | void use_implicit_new_again() { operator new[](3); } |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 30 | |
| 31 | int importMergeUsedFlag = getMergeUsedFlag(); |
| 32 | |
| 33 | @import cxx_decls_merged; |
| 34 | |
| 35 | // CHECK: VarDecl [[mergeUsedFlag:0x[0-9a-f]*]] {{.*}} in cxx_decls.imported used mergeUsedFlag |
| 36 | // CHECK: VarDecl {{0x[0-9a-f]*}} prev [[mergeUsedFlag]] {{.*}} in cxx_decls_merged used mergeUsedFlag |