aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/member-pointers-zero-init.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-08-09 18:26:27 +0000
committerAnders Carlsson <andersca@mac.com>2009-08-09 18:26:27 +0000
commit237957c45774713f81fbd5394b3db4317fef0938 (patch)
treedc262157e60d9a731c838e41b49593980c283fc8 /test/CodeGenCXX/member-pointers-zero-init.cpp
parent25b4fdb9d63095448e6cbc97b8865b36b0c8cbb6 (diff)
Improve handling of member pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/member-pointers-zero-init.cpp')
-rw-r--r--test/CodeGenCXX/member-pointers-zero-init.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGenCXX/member-pointers-zero-init.cpp b/test/CodeGenCXX/member-pointers-zero-init.cpp
new file mode 100644
index 0000000000..db7c71a0d4
--- /dev/null
+++ b/test/CodeGenCXX/member-pointers-zero-init.cpp
@@ -0,0 +1,24 @@
+// RUN: clang-cc -emit-llvm %s -o %t -triple=x86_64-apple-darwin9 &&
+
+struct A {
+ int i;
+};
+
+// RUN: grep "@a = global i64 -1" %t &&
+int A::* a;
+
+// RUN: grep "@aa = global \[2 x i64\] \[i64 -1, i64 -1\], align 8" %t &&
+int A::* aa[2];
+
+// RUN: grep "@aaa = global \[2 x \[2 x i64\]\] \[\[2 x i64\] \[i64 -1, i64 -1\], \[2 x i64\] \[i64 -1, i64 -1\]\]" %t &&
+int A::* aaa[2][2];
+
+void f() {
+ // RUN: grep "%.obool = icmp ne i64 %.mp, -1" %t
+ if (a) { }
+
+ // FIXME: This doesn't yet work
+// if (a != 0) { }
+
+}
+