aboutsummaryrefslogtreecommitdiffstats
path: root/test/FrontendC++/2003-11-09-ConstructorTypeSafety.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/FrontendC++/2003-11-09-ConstructorTypeSafety.cpp')
-rw-r--r--test/FrontendC++/2003-11-09-ConstructorTypeSafety.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/FrontendC++/2003-11-09-ConstructorTypeSafety.cpp b/test/FrontendC++/2003-11-09-ConstructorTypeSafety.cpp
new file mode 100644
index 0000000..e6c09e5
--- /dev/null
+++ b/test/FrontendC++/2003-11-09-ConstructorTypeSafety.cpp
@@ -0,0 +1,21 @@
+// The code generated for this testcase should be completely typesafe!
+// RUN: %llvmgcc -xc++ -S -o - %s | llvm-as | opt -die | llvm-dis | \
+// RUN: notcast
+
+struct contained {
+ unsigned X;
+ contained();
+};
+
+struct base {
+ unsigned A, B;
+};
+
+struct derived : public base {
+ contained _M_value_field;
+};
+
+int test() {
+ derived X;
+}
+