summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/value-init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/value-init.cpp')
-rw-r--r--test/CodeGenCXX/value-init.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CodeGenCXX/value-init.cpp b/test/CodeGenCXX/value-init.cpp
index 37891bd..35be159 100644
--- a/test/CodeGenCXX/value-init.cpp
+++ b/test/CodeGenCXX/value-init.cpp
@@ -23,3 +23,29 @@ void test_value_init() {
C c = { 17 } ;
// CHECK: call void @_ZN1CD1Ev
}
+
+enum enum_type { negative_number = -1, magic_number = 42 };
+
+class enum_holder
+{
+ enum_type m_enum;
+
+public:
+ enum_holder() : m_enum(magic_number) { }
+};
+
+struct enum_holder_and_int
+{
+ enum_holder e;
+ int i;
+};
+
+// CHECK: _Z24test_enum_holder_and_intv()
+void test_enum_holder_and_int() {
+ // CHECK: alloca
+ // CHECK-NEXT: bitcast
+ // CHECK-NEXT: call void @llvm.memset
+ // CHECK-NEXT: call void @_ZN19enum_holder_and_intC1Ev
+ enum_holder_and_int();
+ // CHECK-NEXT: ret void
+}
OpenPOWER on IntegriCloud