blob: bfe0307a0b2e06a1bbe7339ca794657ae39f1e02 [file] [log] [blame]
Douglas Gregor6aa52ec2011-08-26 23:56:07 +00001
Douglas Gregor1b257af2012-12-11 22:11:52 +00002#define import @import
Douglas Gregor6aa52ec2011-08-26 23:56:07 +00003import lookup_left_cxx;
Douglas Gregorc13a34b2012-01-03 19:32:59 +00004#undef import
Douglas Gregor1b257af2012-12-11 22:11:52 +00005#define IMPORT(X) @import X
Douglas Gregor6aa52ec2011-08-26 23:56:07 +00006IMPORT(lookup_right_cxx);
7
Andy Gibbsb42f2002013-04-17 08:06:46 +00008// expected-warning@Inputs/lookup_left.hpp:3 {{weak identifier 'weak_identifier' never declared}}
Jordan Rose7c304f52012-08-10 01:06:16 +00009
Douglas Gregor0d95f772011-08-24 19:03:07 +000010void test(int i, float f) {
11 // unqualified lookup
12 f0(&i);
13 f0(&f);
14
15 // qualified lookup into the translation unit
16 ::f0(&i);
17 ::f0(&f);
18}
19
Douglas Gregord6aba062012-01-04 06:20:15 +000020int import;
21
22void f() {
23 int import;
24}
25
Douglas Gregor14325692011-11-16 00:21:54 +000026// RUN: rm -rf %t
Douglas Gregor953a61f2013-02-07 19:01:24 +000027// RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_left_cxx %S/Inputs/module.map -verify
28// RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_right_cxx %S/Inputs/module.map -verify
Stephen Hines651f13c2014-04-23 16:59:28 -070029// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s -verify
30// RUN: %clang_cc1 -fmodules -ast-print -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s | FileCheck -check-prefix=CHECK-PRINT %s
Douglas Gregorc13a34b2012-01-03 19:32:59 +000031// FIXME: When we have a syntax for modules in C++, use that.
Douglas Gregor851c75a2011-08-24 21:27:34 +000032
33// CHECK-PRINT: int *f0(int *);
34// CHECK-PRINT: float *f0(float *);
35// CHECK-PRINT: void test(int i, float f)
36