summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp2
-rw-r--r--clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index 528cdf6238e..869734ab4e4 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -1628,7 +1628,7 @@ MicrosoftCXXABI::EmitMemberPointerIsNotNull(CodeGenFunction &CGF,
for (int I = 1, E = fields.size(); I < E; ++I) {
llvm::Value *Field = Builder.CreateExtractValue(MemPtr, I);
llvm::Value *Next = Builder.CreateICmpNE(Field, fields[I], "memptr.cmp");
- Res = Builder.CreateAnd(Res, Next, "memptr.tobool");
+ Res = Builder.CreateOr(Res, Next, "memptr.tobool");
}
return Res;
}
diff --git a/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp b/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
index 8d9a848cbcd..c5eeb4ef492 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
@@ -229,10 +229,10 @@ bool nullTestDataUnspecified(int Unspecified::*mp) {
// CHECK: %[[cmp0:.*]] = icmp ne i32 %[[mp0]], 0
// CHECK: %[[mp1:.*]] = extractvalue { i32, i32, i32 } %[[mp]], 1
// CHECK: %[[cmp1:.*]] = icmp ne i32 %[[mp1]], 0
-// CHECK: %[[and0:.*]] = and i1 %[[cmp0]], %[[cmp1]]
+// CHECK: %[[and0:.*]] = or i1 %[[cmp0]], %[[cmp1]]
// CHECK: %[[mp2:.*]] = extractvalue { i32, i32, i32 } %[[mp]], 2
// CHECK: %[[cmp2:.*]] = icmp ne i32 %[[mp2]], -1
-// CHECK: %[[and1:.*]] = and i1 %[[and0]], %[[cmp2]]
+// CHECK: %[[and1:.*]] = or i1 %[[and0]], %[[cmp2]]
// CHECK: ret i1 %[[and1]]
// CHECK: }
}
OpenPOWER on IntegriCloud