Douglas Gregor | 6aa52ec | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 1 | |
Douglas Gregor | 1b257af | 2012-12-11 22:11:52 +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 |
Douglas Gregor | 1b257af | 2012-12-11 22:11:52 +0000 | [diff] [blame] | 5 | #define IMPORT(X) @import X |
Douglas Gregor | 6aa52ec | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 6 | IMPORT(lookup_right_cxx); |
| 7 | |
Andy Gibbs | b42f200 | 2013-04-17 08:06:46 +0000 | [diff] [blame] | 8 | // expected-warning@Inputs/lookup_left.hpp:3 {{weak identifier 'weak_identifier' never declared}} |
Jordan Rose | 7c304f5 | 2012-08-10 01:06:16 +0000 | [diff] [blame] | 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 | 953a61f | 2013-02-07 19:01:24 +0000 | [diff] [blame] | 27 | // RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_left_cxx %S/Inputs/module.map -verify |
| 28 | // RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_right_cxx %S/Inputs/module.map -verify |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 29 | // RUN: %clang_cc1 -fmodules -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s -verify |
| 30 | // RUN: %clang_cc1 -fmodules -ast-print -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s | FileCheck -check-prefix=CHECK-PRINT %s |
Douglas Gregor | c13a34b | 2012-01-03 19:32:59 +0000 | [diff] [blame] | 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 | |