Douglas Gregor | 6aa52ec | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 1 | |
| 2 | #define import __import__ |
| 3 | import lookup_left_cxx; |
| 4 | #define IMPORT(X) __import__ X |
| 5 | IMPORT(lookup_right_cxx); |
| 6 | |
Douglas Gregor | 0d95f77 | 2011-08-24 19:03:07 +0000 | [diff] [blame] | 7 | void test(int i, float f) { |
| 8 | // unqualified lookup |
| 9 | f0(&i); |
| 10 | f0(&f); |
| 11 | |
| 12 | // qualified lookup into the translation unit |
| 13 | ::f0(&i); |
| 14 | ::f0(&f); |
| 15 | } |
| 16 | |
Douglas Gregor | 6aa52ec | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 17 | // RUN: %clang_cc1 -emit-module -x c++ -verify -o %T/lookup_left_cxx.pcm %S/Inputs/lookup_left.hpp |
| 18 | // RUN: %clang_cc1 -emit-module -x c++ -o %T/lookup_right_cxx.pcm %S/Inputs/lookup_right.hpp |
| 19 | // RUN: %clang_cc1 -x c++ -I %T %s -verify |
| 20 | // RUN: %clang_cc1 -ast-print -x c++ -I %T %s | FileCheck -check-prefix=CHECK-PRINT %s |
Douglas Gregor | 851c75a | 2011-08-24 21:27:34 +0000 | [diff] [blame] | 21 | |
| 22 | // CHECK-PRINT: int *f0(int *); |
| 23 | // CHECK-PRINT: float *f0(float *); |
| 24 | // CHECK-PRINT: void test(int i, float f) |
| 25 | |