r291452 - Split dllexport default constructor closure tests out into a separate file
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 9 09:25:31 PST 2017
Author: rnk
Date: Mon Jan 9 11:25:30 2017
New Revision: 291452
URL: http://llvm.org/viewvc/llvm-project?rev=291452&view=rev
Log:
Split dllexport default constructor closure tests out into a separate file
test/CodeGenCXX/dllexport.cpp has grown quite large at this point. NFC
Added:
cfe/trunk/test/CodeGenCXX/dllexport-ctor-closure.cpp
Modified:
cfe/trunk/test/CodeGenCXX/dllexport.cpp
Added: cfe/trunk/test/CodeGenCXX/dllexport-ctor-closure.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllexport-ctor-closure.cpp?rev=291452&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllexport-ctor-closure.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/dllexport-ctor-closure.cpp Mon Jan 9 11:25:30 2017
@@ -0,0 +1,63 @@
+// RUN: %clang_cc1 -triple i686-windows-msvc -emit-llvm -std=c++14 \
+// RUN: -fno-threadsafe-statics -fms-extensions -O1 -mconstructor-aliases \
+// RUN: -disable-llvm-passes -o - %s -w -fms-compatibility-version=19.00 | \
+// RUN: FileCheck %s
+
+struct CtorWithClosure {
+ __declspec(dllexport) CtorWithClosure(...) {}
+// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FCtorWithClosure@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
+// CHECK: %[[this_addr:.*]] = alloca %struct.CtorWithClosure*, align 4
+// CHECK: store %struct.CtorWithClosure* %this, %struct.CtorWithClosure** %[[this_addr]], align 4
+// CHECK: %[[this:.*]] = load %struct.CtorWithClosure*, %struct.CtorWithClosure** %[[this_addr]]
+// CHECK: call %struct.CtorWithClosure* (%struct.CtorWithClosure*, ...) @"\01??0CtorWithClosure@@QAA at ZZ"(%struct.CtorWithClosure* %[[this]])
+// CHECK: ret void
+};
+
+struct CtorWithClosureOutOfLine {
+ __declspec(dllexport) CtorWithClosureOutOfLine(...);
+};
+CtorWithClosureOutOfLine::CtorWithClosureOutOfLine(...) {}
+// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FCtorWithClosureOutOfLine@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
+
+#define DELETE_IMPLICIT_MEMBERS(ClassName) \
+ ClassName(ClassName &&) = delete; \
+ ClassName(ClassName &) = delete; \
+ ~ClassName() = delete; \
+ ClassName &operator=(ClassName &) = delete
+
+struct __declspec(dllexport) ClassWithClosure {
+ DELETE_IMPLICIT_MEMBERS(ClassWithClosure);
+ ClassWithClosure(...) {}
+// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FClassWithClosure@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
+// CHECK: %[[this_addr:.*]] = alloca %struct.ClassWithClosure*, align 4
+// CHECK: store %struct.ClassWithClosure* %this, %struct.ClassWithClosure** %[[this_addr]], align 4
+// CHECK: %[[this:.*]] = load %struct.ClassWithClosure*, %struct.ClassWithClosure** %[[this_addr]]
+// CHECK: call %struct.ClassWithClosure* (%struct.ClassWithClosure*, ...) @"\01??0ClassWithClosure@@QAA at ZZ"(%struct.ClassWithClosure* %[[this]])
+// CHECK: ret void
+};
+
+template <typename T> struct TemplateWithClosure {
+ TemplateWithClosure(int x = sizeof(T)) {}
+};
+extern template struct TemplateWithClosure<char>;
+template struct __declspec(dllexport) TemplateWithClosure<char>;
+extern template struct TemplateWithClosure<int>;
+template struct __declspec(dllexport) TemplateWithClosure<int>;
+
+// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_F?$TemplateWithClosure at D@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
+// CHECK: call {{.*}} @"\01??0?$TemplateWithClosure at D@@QAE at H@Z"({{.*}}, i32 1)
+
+// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_F?$TemplateWithClosure at H@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
+// CHECK: call {{.*}} @"\01??0?$TemplateWithClosure at H@@QAE at H@Z"({{.*}}, i32 4)
+
+struct __declspec(dllexport) NestedOuter {
+ DELETE_IMPLICIT_MEMBERS(NestedOuter);
+ NestedOuter(void *p = 0) {}
+ struct __declspec(dllexport) NestedInner {
+ DELETE_IMPLICIT_MEMBERS(NestedInner);
+ NestedInner(void *p = 0) {}
+ };
+};
+
+// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FNestedOuter@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
+// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FNestedInner at NestedOuter@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
Modified: cfe/trunk/test/CodeGenCXX/dllexport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllexport.cpp?rev=291452&r1=291451&r2=291452&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllexport.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllexport.cpp Mon Jan 9 11:25:30 2017
@@ -488,63 +488,6 @@ struct S {
};
};
-struct CtorWithClosure {
- __declspec(dllexport) CtorWithClosure(...) {}
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_FCtorWithClosure@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
-// M32-DAG: %[[this_addr:.*]] = alloca %struct.CtorWithClosure*, align 4
-// M32-DAG: store %struct.CtorWithClosure* %this, %struct.CtorWithClosure** %[[this_addr]], align 4
-// M32-DAG: %[[this:.*]] = load %struct.CtorWithClosure*, %struct.CtorWithClosure** %[[this_addr]]
-// M32-DAG: call %struct.CtorWithClosure* (%struct.CtorWithClosure*, ...) @"\01??0CtorWithClosure@@QAA at ZZ"(%struct.CtorWithClosure* %[[this]])
-// M32-DAG: ret void
-};
-
-struct CtorWithClosureOutOfLine {
- __declspec(dllexport) CtorWithClosureOutOfLine(...);
-};
-CtorWithClosureOutOfLine::CtorWithClosureOutOfLine(...) {}
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_FCtorWithClosureOutOfLine@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
-
-#define DELETE_IMPLICIT_MEMBERS(ClassName) \
- ClassName(ClassName &&) = delete; \
- ClassName(ClassName &) = delete; \
- ~ClassName() = delete; \
- ClassName &operator=(ClassName &) = delete
-
-struct __declspec(dllexport) ClassWithClosure {
- DELETE_IMPLICIT_MEMBERS(ClassWithClosure);
- ClassWithClosure(...) {}
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_FClassWithClosure@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
-// M32-DAG: %[[this_addr:.*]] = alloca %struct.ClassWithClosure*, align 4
-// M32-DAG: store %struct.ClassWithClosure* %this, %struct.ClassWithClosure** %[[this_addr]], align 4
-// M32-DAG: %[[this:.*]] = load %struct.ClassWithClosure*, %struct.ClassWithClosure** %[[this_addr]]
-// M32-DAG: call %struct.ClassWithClosure* (%struct.ClassWithClosure*, ...) @"\01??0ClassWithClosure@@QAA at ZZ"(%struct.ClassWithClosure* %[[this]])
-// M32-DAG: ret void
-};
-
-template <typename T> struct TemplateWithClosure {
- TemplateWithClosure(int x = sizeof(T)) {}
-};
-extern template struct TemplateWithClosure<char>;
-template struct __declspec(dllexport) TemplateWithClosure<char>;
-extern template struct TemplateWithClosure<int>;
-template struct __declspec(dllexport) TemplateWithClosure<int>;
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_F?$TemplateWithClosure at D@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
-// M32-DAG: call {{.*}} @"\01??0?$TemplateWithClosure at D@@QAE at H@Z"({{.*}}, i32 1)
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_F?$TemplateWithClosure at H@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
-// M32-DAG: call {{.*}} @"\01??0?$TemplateWithClosure at H@@QAE at H@Z"({{.*}}, i32 4)
-
-struct __declspec(dllexport) NestedOuter {
- DELETE_IMPLICIT_MEMBERS(NestedOuter);
- NestedOuter(void *p = 0) {}
- struct __declspec(dllexport) NestedInner {
- DELETE_IMPLICIT_MEMBERS(NestedInner);
- NestedInner(void *p = 0) {}
- };
-};
-
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_FNestedOuter@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_FNestedInner at NestedOuter@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
-
template <typename T>
struct SomeTemplate {
SomeTemplate(T o = T()) : o(o) {}
More information about the cfe-commits
mailing list