aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-09-02 17:28:31 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-09-02 17:28:31 +0000
commit73556e0d961e2d58eae232e647c9def8da1caecf (patch)
treeeae15f2d231563dc9e61bd5e9e94184efd89297e
parent70b9b448efbebddddb3faa3a68b31ee1682bcd5c (diff)
Another i1 vs. i8 type mismatch issue. This time
a 'bool' byref variable in memory. Fixes radar 8382559. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112835 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGDecl.cpp2
-rw-r--r--test/CodeGenCXX/reference-in-blocks.cpp10
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 8ce196b64e..d4c65e3e74 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -373,7 +373,7 @@ const llvm::Type *CodeGenFunction::BuildByRefType(const ValueDecl *D) {
}
// T x;
- Types.push_back(ConvertType(Ty));
+ Types.push_back(ConvertTypeForMem(Ty));
const llvm::Type *T = llvm::StructType::get(VMContext, Types, Packed);
diff --git a/test/CodeGenCXX/reference-in-blocks.cpp b/test/CodeGenCXX/reference-in-blocks.cpp
index 388ec7c4bb..f08ef56880 100644
--- a/test/CodeGenCXX/reference-in-blocks.cpp
+++ b/test/CodeGenCXX/reference-in-blocks.cpp
@@ -41,3 +41,13 @@ int main() {
a->F();
return 0;
}
+
+// rdar://8382559
+namespace radar8382559 {
+ void func(bool& outHasProperty);
+
+ void test() {
+ __attribute__((__blocks__(byref))) bool hasProperty = false;
+ func(hasProperty);
+ }
+}