16aa52ec6b969faabf3764baf79d89810b8249a7eDouglas Gregor
21b257afbae854c6817f26b7d61c4fed8ff7aebadDouglas Gregor#define import @import
36aa52ec6b969faabf3764baf79d89810b8249a7eDouglas Gregorimport lookup_left_cxx;
4c13a34b690d2dc2a03c2fea75a0a1438636c19ceDouglas Gregor#undef import
51b257afbae854c6817f26b7d61c4fed8ff7aebadDouglas Gregor#define IMPORT(X) @import X
66aa52ec6b969faabf3764baf79d89810b8249a7eDouglas GregorIMPORT(lookup_right_cxx);
76aa52ec6b969faabf3764baf79d89810b8249a7eDouglas Gregor
8b42f200777a66b98989160bf3987ce431540a584Andy Gibbs// expected-warning@Inputs/lookup_left.hpp:3 {{weak identifier 'weak_identifier' never declared}}
97c304f56eecbd03db7d222a05dfcd593750d50d3Jordan Rose
100d95f77ba180aee35b74f3bf9f8543477f3af543Douglas Gregorvoid test(int i, float f) {
110d95f77ba180aee35b74f3bf9f8543477f3af543Douglas Gregor  // unqualified lookup
120d95f77ba180aee35b74f3bf9f8543477f3af543Douglas Gregor  f0(&i);
130d95f77ba180aee35b74f3bf9f8543477f3af543Douglas Gregor  f0(&f);
140d95f77ba180aee35b74f3bf9f8543477f3af543Douglas Gregor
150d95f77ba180aee35b74f3bf9f8543477f3af543Douglas Gregor  // qualified lookup into the translation unit
160d95f77ba180aee35b74f3bf9f8543477f3af543Douglas Gregor  ::f0(&i);
170d95f77ba180aee35b74f3bf9f8543477f3af543Douglas Gregor  ::f0(&f);
180d95f77ba180aee35b74f3bf9f8543477f3af543Douglas Gregor}
190d95f77ba180aee35b74f3bf9f8543477f3af543Douglas Gregor
20d6aba06861c41ccbc4926e5fe3cecd97b20410c0Douglas Gregorint import;
21d6aba06861c41ccbc4926e5fe3cecd97b20410c0Douglas Gregor
22d6aba06861c41ccbc4926e5fe3cecd97b20410c0Douglas Gregorvoid f() {
23d6aba06861c41ccbc4926e5fe3cecd97b20410c0Douglas Gregor int import;
24d6aba06861c41ccbc4926e5fe3cecd97b20410c0Douglas Gregor}
25d6aba06861c41ccbc4926e5fe3cecd97b20410c0Douglas Gregor
261432569f88c6da4da902df7571621f3ea3f76596Douglas Gregor// RUN: rm -rf %t
27953a61f26bf79932b9699b09add4c388764de170Douglas Gregor// RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_left_cxx %S/Inputs/module.map -verify
28953a61f26bf79932b9699b09add4c388764de170Douglas Gregor// RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_right_cxx %S/Inputs/module.map -verify
29651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s -verify
30651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines// RUN: %clang_cc1 -fmodules -ast-print -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s | FileCheck -check-prefix=CHECK-PRINT %s
31c13a34b690d2dc2a03c2fea75a0a1438636c19ceDouglas Gregor// FIXME: When we have a syntax for modules in C++, use that.
32851c75a279bb4441bc6802d0258ceb4ab64738d4Douglas Gregor
33851c75a279bb4441bc6802d0258ceb4ab64738d4Douglas Gregor// CHECK-PRINT: int *f0(int *);
34851c75a279bb4441bc6802d0258ceb4ab64738d4Douglas Gregor// CHECK-PRINT: float *f0(float *);
35851c75a279bb4441bc6802d0258ceb4ab64738d4Douglas Gregor// CHECK-PRINT: void test(int i, float f)
36851c75a279bb4441bc6802d0258ceb4ab64738d4Douglas Gregor
37