Douglas Gregor | 6aa52ec | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 1 | |
Ted Kremenek | 32ad2ee | 2012-03-01 22:07:04 +0000 | [diff] [blame] | 2 | #define import @__experimental_modules_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 |
Ted Kremenek | 32ad2ee | 2012-03-01 22:07:04 +0000 | [diff] [blame] | 5 | #define IMPORT(X) @__experimental_modules_import X |
Douglas Gregor | 6aa52ec | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 6 | IMPORT(lookup_right_cxx); |
| 7 | |
Jordan Rose | 7c304f5 | 2012-08-10 01:06:16 +0000 | [diff] [blame] | 8 | // in lookup_left.hpp: expected-warning@3 {{weak identifier 'weak_identifier' never declared}} |
| 9 | |
Douglas Gregor | 0d95f77 | 2011-08-24 19:03:07 +0000 | [diff] [blame] | 10 | void 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 Gregor | d6aba06 | 2012-01-04 06:20:15 +0000 | [diff] [blame] | 20 | int import; |
| 21 | |
| 22 | void f() { |
| 23 | int import; |
| 24 | } |
| 25 | |
Douglas Gregor | 1432569 | 2011-11-16 00:21:54 +0000 | [diff] [blame] | 26 | // RUN: rm -rf %t |
Douglas Gregor | c13a34b | 2012-01-03 19:32:59 +0000 | [diff] [blame] | 27 | // 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 Gregor | 851c75a | 2011-08-24 21:27:34 +0000 | [diff] [blame] | 32 | |
| 33 | // CHECK-PRINT: int *f0(int *); |
| 34 | // CHECK-PRINT: float *f0(float *); |
| 35 | // CHECK-PRINT: void test(int i, float f) |
| 36 | |