blob: 98390355339e6ad3883f63001e6efc53148e7da9 [file] [log] [blame]
Douglas Gregor6aa52ec2011-08-26 23:56:07 +00001
Ted Kremenek32ad2ee2012-03-01 22:07:04 +00002#define import @__experimental_modules_import
Douglas Gregor6aa52ec2011-08-26 23:56:07 +00003import lookup_left_cxx;
Douglas Gregorc13a34b2012-01-03 19:32:59 +00004#undef import
Ted Kremenek32ad2ee2012-03-01 22:07:04 +00005#define IMPORT(X) @__experimental_modules_import X
Douglas Gregor6aa52ec2011-08-26 23:56:07 +00006IMPORT(lookup_right_cxx);
7
Douglas Gregor0d95f772011-08-24 19:03:07 +00008void test(int i, float f) {
9 // unqualified lookup
10 f0(&i);
11 f0(&f);
12
13 // qualified lookup into the translation unit
14 ::f0(&i);
15 ::f0(&f);
16}
17
Douglas Gregord6aba062012-01-04 06:20:15 +000018int import;
19
20void f() {
21 int import;
22}
23
Douglas Gregor14325692011-11-16 00:21:54 +000024// RUN: rm -rf %t
Douglas Gregorc13a34b2012-01-03 19:32:59 +000025// RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodule-cache-path %t -fmodule-name=lookup_left_cxx %S/Inputs/module.map -verify
26// RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodule-cache-path %t -fmodule-name=lookup_right_cxx %S/Inputs/module.map -verify
27// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t %s -verify
28// RUN: %clang_cc1 -fmodules -ast-print -x objective-c++ -fmodule-cache-path %t %s | FileCheck -check-prefix=CHECK-PRINT %s
29// FIXME: When we have a syntax for modules in C++, use that.
Douglas Gregor851c75a2011-08-24 21:27:34 +000030
31// CHECK-PRINT: int *f0(int *);
32// CHECK-PRINT: float *f0(float *);
33// CHECK-PRINT: void test(int i, float f)
34