summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC/strong-in-c-struct.m
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2019-07-26 00:02:17 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2019-07-26 00:02:17 +0000
commit6f6156b9fc81b64b61c53360735c2771c381187f (patch)
treed90fd21e7f39b321b58c58eb15523d6eb2895e6d /clang/test/CodeGenObjC/strong-in-c-struct.m
parentc07fe307b48a98a149578948b167802f7b2825cf (diff)
downloadbcm5719-llvm-6f6156b9fc81b64b61c53360735c2771c381187f.tar.gz
bcm5719-llvm-6f6156b9fc81b64b61c53360735c2771c381187f.zip
Revert "[Sema] Diagnose default-initialization, destruction, and copying of"
This reverts commit r365985. Prior to r365985, clang used to mark C union fields that have non-trivial ObjC ownership qualifiers as unavailable if the union was declared in a system header. r365985 stopped doing so, which caused the swift compiler to crash when it tried to import a non-trivial union. I have a patch that fixes the crash (https://reviews.llvm.org/D65256), but I'm temporarily reverting the original patch until we can decide on whether it's taking the right approach. llvm-svn: 367076
Diffstat (limited to 'clang/test/CodeGenObjC/strong-in-c-struct.m')
-rw-r--r--clang/test/CodeGenObjC/strong-in-c-struct.m15
1 files changed, 12 insertions, 3 deletions
diff --git a/clang/test/CodeGenObjC/strong-in-c-struct.m b/clang/test/CodeGenObjC/strong-in-c-struct.m
index 8eeee4af0d3..19cc1037c4c 100644
--- a/clang/test/CodeGenObjC/strong-in-c-struct.m
+++ b/clang/test/CodeGenObjC/strong-in-c-struct.m
@@ -1,10 +1,11 @@
-// RUN: %clang_cc1 -triple arm64-apple-ios11 -fobjc-arc -fblocks -fobjc-runtime=ios-11.0 -emit-llvm -o - -DUSESTRUCT %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm64-apple-ios11 -fobjc-arc -fblocks -fobjc-runtime=ios-11.0 -emit-llvm -o - -DUSESTRUCT -I %S/Inputs %s | FileCheck %s
-// RUN: %clang_cc1 -triple arm64-apple-ios11 -fobjc-arc -fblocks -fobjc-runtime=ios-11.0 -emit-pch -o %t %s
-// RUN: %clang_cc1 -triple arm64-apple-ios11 -fobjc-arc -fblocks -fobjc-runtime=ios-11.0 -include-pch %t -emit-llvm -o - -DUSESTRUCT %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm64-apple-ios11 -fobjc-arc -fblocks -fobjc-runtime=ios-11.0 -emit-pch -I %S/Inputs -o %t %s
+// RUN: %clang_cc1 -triple arm64-apple-ios11 -fobjc-arc -fblocks -fobjc-runtime=ios-11.0 -include-pch %t -emit-llvm -o - -DUSESTRUCT -I %S/Inputs %s | FileCheck %s
#ifndef HEADER
#define HEADER
+#include "strong_in_union.h"
typedef void (^BlockTy)(void);
@@ -694,6 +695,14 @@ void test_copy_constructor_Bitfield1(Bitfield1 *a) {
Bitfield1 t = *a;
}
+// CHECK: define void @test_strong_in_union()
+// CHECK: alloca %{{.*}}
+// CHECK-NEXT: ret void
+
+void test_strong_in_union() {
+ U t;
+}
+
// CHECK: define void @test_copy_constructor_VolatileArray(
// CHECK: call void @__copy_constructor_8_8_s0_AB8s4n16_tv64w32_AE(
OpenPOWER on IntegriCloud