aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/member-pointers-zero-init.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-08-24 18:26:39 +0000
committerAnders Carlsson <andersca@mac.com>2009-08-24 18:26:39 +0000
commite9776247577715ad3a19461769a3488a445a8cbd (patch)
tree99df917699cb1433115a4c12c04f7d417d76b038 /test/CodeGenCXX/member-pointers-zero-init.cpp
parent4e382f3130834ac9862047a1f40402f261424774 (diff)
Handle CK_NullToMemberPointer in ScalarExprEmitter::EmitCast
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/member-pointers-zero-init.cpp')
-rw-r--r--test/CodeGenCXX/member-pointers-zero-init.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/CodeGenCXX/member-pointers-zero-init.cpp b/test/CodeGenCXX/member-pointers-zero-init.cpp
index d533600b54..e7b0fdafba 100644
--- a/test/CodeGenCXX/member-pointers-zero-init.cpp
+++ b/test/CodeGenCXX/member-pointers-zero-init.cpp
@@ -17,11 +17,18 @@ int A::* aaa[2][2];
int A::* b = 0;
void f() {
- // RUN: grep "%.* = icmp ne i64 %.*, -1" %t
+ // RUN: grep "%.* = icmp ne i64 %.*, -1" %t | count 2 &&
if (a) { }
+ if (a != 0) { }
+
+ // RUN: grep "%.* = icmp ne i64 -1, %.*" %t | count 1 &&
+ if (0 != a) { }
- // FIXME: This doesn't yet work
-// if (a != 0) { }
+ // RUN: grep "%.* = icmp eq i64 %.*, -1" %t | count 1 &&
+ if (a == 0) { }
+
+ // RUN: grep "%.* = icmp eq i64 -1, %.*" %t | count 1
+ if (0 == a) { }
}