Douglas Gregor | 6aa52ec | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 1 | |
Douglas Gregor | c13a34b | 2012-01-03 19:32:59 +0000 | [diff] [blame] | 2 | #define import @import |
Douglas Gregor | 6aa52ec | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 3 | import lookup_left_cxx; |
Douglas Gregor | c13a34b | 2012-01-03 19:32:59 +0000 | [diff] [blame] | 4 | #undef import |
| 5 | #define IMPORT(X) @import X |
Douglas Gregor | 6aa52ec | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 6 | IMPORT(lookup_right_cxx); |
| 7 | |
Douglas Gregor | 0d95f77 | 2011-08-24 19:03:07 +0000 | [diff] [blame] | 8 | void 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 Gregor | d6aba06 | 2012-01-04 06:20:15 +0000 | [diff] [blame] | 18 | int import; |
| 19 | |
| 20 | void f() { |
| 21 | int import; |
| 22 | } |
| 23 | |
Douglas Gregor | 1432569 | 2011-11-16 00:21:54 +0000 | [diff] [blame] | 24 | // RUN: rm -rf %t |
Douglas Gregor | c13a34b | 2012-01-03 19:32:59 +0000 | [diff] [blame] | 25 | // 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 Gregor | 851c75a | 2011-08-24 21:27:34 +0000 | [diff] [blame] | 30 | |
| 31 | // CHECK-PRINT: int *f0(int *); |
| 32 | // CHECK-PRINT: float *f0(float *); |
| 33 | // CHECK-PRINT: void test(int i, float f) |
| 34 | |