summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/Inputs/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Modules/Inputs/codegen')
-rw-r--r--clang/test/Modules/Inputs/codegen/foo.h26
-rw-r--r--clang/test/Modules/Inputs/codegen/use.cpp8
2 files changed, 34 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/codegen/foo.h b/clang/test/Modules/Inputs/codegen/foo.h
index 3fcab718573..e77e8d1824e 100644
--- a/clang/test/Modules/Inputs/codegen/foo.h
+++ b/clang/test/Modules/Inputs/codegen/foo.h
@@ -2,3 +2,29 @@ inline void f1(const char* fmt, ...) {
__builtin_va_list args;
__builtin_va_start(args, fmt);
}
+
+struct non_trivial_dtor {
+ ~non_trivial_dtor();
+};
+
+struct implicit_dtor {
+ non_trivial_dtor d;
+};
+
+struct uninst_implicit_dtor {
+ non_trivial_dtor d;
+};
+
+inline void use_implicit_dtor() {
+ implicit_dtor d;
+}
+
+template <typename T>
+void inst() {
+}
+
+inline void inst_decl() {
+ // cause inst<int>'s declaration to be instantiated, without a definition.
+ (void)sizeof(&inst<int>);
+ inst<float>();
+}
diff --git a/clang/test/Modules/Inputs/codegen/use.cpp b/clang/test/Modules/Inputs/codegen/use.cpp
new file mode 100644
index 00000000000..cd1a4a642d0
--- /dev/null
+++ b/clang/test/Modules/Inputs/codegen/use.cpp
@@ -0,0 +1,8 @@
+#include "foo.h"
+void non_modular_use_of_implicit_dtor() {
+ implicit_dtor d1;
+ uninst_implicit_dtor d2;
+}
+void use_of_instantiated_declaration_without_definition() {
+ inst<int>();
+}
OpenPOWER on IntegriCloud