blob: 76e1f6aae2eba9a7f610cd7c7f34d040420026fe [file] [log] [blame]
Douglas Gregor08142532011-08-26 23:56:07 +00001
Douglas Gregorc50d4922012-12-11 22:11:52 +00002#define import @import
Douglas Gregor08142532011-08-26 23:56:07 +00003import lookup_left_cxx;
Douglas Gregorda82e702012-01-03 19:32:59 +00004#undef import
Douglas Gregorc50d4922012-12-11 22:11:52 +00005#define IMPORT(X) @import X
Douglas Gregor08142532011-08-26 23:56:07 +00006IMPORT(lookup_right_cxx);
7
Jordan Roseb00073d2012-08-10 01:06:16 +00008// in lookup_left.hpp: expected-warning@3 {{weak identifier 'weak_identifier' never declared}}
9
Douglas Gregor94619c82011-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 Gregor8d76cca2012-01-04 06:20:15 +000020int import;
21
22void f() {
23 int import;
24}
25
Douglas Gregor81ac8422011-11-16 00:21:54 +000026// RUN: rm -rf %t
Douglas Gregorda82e702012-01-03 19:32:59 +000027// RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodule-cache-path %t -fmodule-name=lookup_left_cxx %S/Inputs/module.map -verify
28// RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodule-cache-path %t -fmodule-name=lookup_right_cxx %S/Inputs/module.map -verify
29// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t %s -verify
30// RUN: %clang_cc1 -fmodules -ast-print -x objective-c++ -fmodule-cache-path %t %s | FileCheck -check-prefix=CHECK-PRINT %s
31// FIXME: When we have a syntax for modules in C++, use that.
Douglas Gregor1257f972011-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