Douglas Gregor | 0814253 | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 1 | |
Douglas Gregor | da82e70 | 2012-01-03 19:32:59 +0000 | [diff] [blame^] | 2 | #define import @import |
Douglas Gregor | 0814253 | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 3 | import lookup_left_cxx; |
Douglas Gregor | da82e70 | 2012-01-03 19:32:59 +0000 | [diff] [blame^] | 4 | #undef import |
| 5 | #define IMPORT(X) @import X |
Douglas Gregor | 0814253 | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 6 | IMPORT(lookup_right_cxx); |
| 7 | |
Douglas Gregor | 94619c8 | 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 | 81ac842 | 2011-11-16 00:21:54 +0000 | [diff] [blame] | 18 | // RUN: rm -rf %t |
Douglas Gregor | da82e70 | 2012-01-03 19:32:59 +0000 | [diff] [blame^] | 19 | // RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodule-cache-path %t -fmodule-name=lookup_left_cxx %S/Inputs/module.map -verify |
| 20 | // RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodule-cache-path %t -fmodule-name=lookup_right_cxx %S/Inputs/module.map -verify |
| 21 | // RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t %s -verify |
| 22 | // RUN: %clang_cc1 -fmodules -ast-print -x objective-c++ -fmodule-cache-path %t %s | FileCheck -check-prefix=CHECK-PRINT %s |
| 23 | // FIXME: When we have a syntax for modules in C++, use that. |
Douglas Gregor | 1257f97 | 2011-08-24 21:27:34 +0000 | [diff] [blame] | 24 | |
| 25 | // CHECK-PRINT: int *f0(int *); |
| 26 | // CHECK-PRINT: float *f0(float *); |
| 27 | // CHECK-PRINT: void test(int i, float f) |
| 28 | |