mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 21:53:12 +08:00
[modules] Additional tests.
llvm-svn: 293223
This commit is contained in:
2
clang/test/Modules/Inputs/anon-redecl/a.h
Normal file
2
clang/test/Modules/Inputs/anon-redecl/a.h
Normal file
@@ -0,0 +1,2 @@
|
||||
struct X { union { int n; }; };
|
||||
inline int a(X x) { return x.n; }
|
||||
2
clang/test/Modules/Inputs/anon-redecl/b.h
Normal file
2
clang/test/Modules/Inputs/anon-redecl/b.h
Normal file
@@ -0,0 +1,2 @@
|
||||
struct X { union { int n; }; };
|
||||
inline int b(X x) { return x.n; }
|
||||
2
clang/test/Modules/Inputs/anon-redecl/c1.h
Normal file
2
clang/test/Modules/Inputs/anon-redecl/c1.h
Normal file
@@ -0,0 +1,2 @@
|
||||
#include "a.h"
|
||||
#include "b.h"
|
||||
2
clang/test/Modules/Inputs/anon-redecl/c2.h
Normal file
2
clang/test/Modules/Inputs/anon-redecl/c2.h
Normal file
@@ -0,0 +1,2 @@
|
||||
struct X { union { int n; }; };
|
||||
inline int c(X x) { return x.n; }
|
||||
6
clang/test/Modules/Inputs/anon-redecl/module.modulemap
Normal file
6
clang/test/Modules/Inputs/anon-redecl/module.modulemap
Normal file
@@ -0,0 +1,6 @@
|
||||
module a { header "a.h" }
|
||||
module b { header "b.h" }
|
||||
module c {
|
||||
module c1 { header "c1.h" }
|
||||
module c2 { header "c2.h" }
|
||||
}
|
||||
3
clang/test/Modules/Inputs/hidden-names/hidden.h
Normal file
3
clang/test/Modules/Inputs/hidden-names/hidden.h
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace NS {
|
||||
struct X {};
|
||||
}
|
||||
4
clang/test/Modules/Inputs/hidden-names/module.modulemap
Normal file
4
clang/test/Modules/Inputs/hidden-names/module.modulemap
Normal file
@@ -0,0 +1,4 @@
|
||||
module hidden {
|
||||
header "visible.h"
|
||||
explicit module sub { header "hidden.h" }
|
||||
}
|
||||
2
clang/test/Modules/Inputs/hidden-names/visible.h
Normal file
2
clang/test/Modules/Inputs/hidden-names/visible.h
Normal file
@@ -0,0 +1,2 @@
|
||||
// hidden-names/visible.h
|
||||
namespace NS {}
|
||||
4
clang/test/Modules/Inputs/merge-function-defs/a.h
Normal file
4
clang/test/Modules/Inputs/merge-function-defs/a.h
Normal file
@@ -0,0 +1,4 @@
|
||||
struct X {
|
||||
virtual void f();
|
||||
};
|
||||
inline void X::f() {}
|
||||
0
clang/test/Modules/Inputs/merge-function-defs/b.h
Normal file
0
clang/test/Modules/Inputs/merge-function-defs/b.h
Normal file
4
clang/test/Modules/Inputs/merge-function-defs/map
Normal file
4
clang/test/Modules/Inputs/merge-function-defs/map
Normal file
@@ -0,0 +1,4 @@
|
||||
module m {
|
||||
module a { header "a.h" }
|
||||
module b { header "b.h" }
|
||||
}
|
||||
15
clang/test/Modules/anon-redecl.cpp
Normal file
15
clang/test/Modules/anon-redecl.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
// RUN: rm -rf %t
|
||||
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodules-local-submodule-visibility \
|
||||
// RUN: -fmodule-map-file=%S/Inputs/anon-redecl/module.modulemap \
|
||||
// RUN: -I%S/Inputs/anon-redecl \
|
||||
// RUN: -verify -std=c++11 %s
|
||||
|
||||
#include "a.h"
|
||||
#include "b.h"
|
||||
#include "c1.h"
|
||||
#include "c2.h"
|
||||
|
||||
// expected-no-diagnostics
|
||||
int x = a({});
|
||||
int y = b({});
|
||||
int z = c({});
|
||||
13
clang/test/Modules/hidden-names.cpp
Normal file
13
clang/test/Modules/hidden-names.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
// RUN: rm -rf %t
|
||||
// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/hidden-names %s -verify
|
||||
// expected-no-diagnostics
|
||||
|
||||
#include "visible.h"
|
||||
|
||||
using namespace NS;
|
||||
|
||||
namespace {
|
||||
struct X { void f(); };
|
||||
}
|
||||
|
||||
void X::f() {}
|
||||
11
clang/test/Modules/merge-function-defs.cpp
Normal file
11
clang/test/Modules/merge-function-defs.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
// RUN: rm -rf %t
|
||||
// RUN: %clang_cc1 -I%S/Inputs/merge-function-defs -fmodules -fmodule-map-file=%S/Inputs/merge-function-defs/map -fmodules-cache-path=%t %s -emit-llvm-only
|
||||
|
||||
#include "b.h"
|
||||
|
||||
struct X {
|
||||
virtual void f();
|
||||
};
|
||||
inline void X::f() {}
|
||||
|
||||
X x;
|
||||
Reference in New Issue
Block a user