[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / lookup.cpp
blob95c30bf3eedffec7e810b4d13d8eeccbc30c03e4
2 #define import @import
3 import lookup_left_cxx;
4 #undef import
5 #define IMPORT(X) @import X
6 IMPORT(lookup_right_cxx);
8 // expected-warning@Inputs/lookup_left.hpp:3 {{weak identifier 'weak_identifier' never declared}}
10 void test(int i, float f) {
11 // unqualified lookup
12 f0(&i);
13 f0(&f);
15 // qualified lookup into the translation unit
16 ::f0(&i);
17 ::f0(&f);
20 int import;
22 void f() {
23 int import;
26 // RUN: rm -rf %t
27 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_left_cxx %S/Inputs/module.modulemap -verify
28 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_right_cxx %S/Inputs/module.modulemap -verify
29 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s -verify
30 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -ast-print -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s | FileCheck -check-prefix=CHECK-PRINT %s
31 // FIXME: When we have a syntax for modules in C++, use that.
33 // CHECK-PRINT: int *f0(int *);
34 // CHECK-PRINT: float *f0(float *);
35 // CHECK-PRINT: void test(int i, float f)