]> granicus.if.org Git - clang/commitdiff
Add a lit test for PR31374
authorYaxun Liu <Yaxun.Liu@amd.com>
Mon, 19 Dec 2016 02:55:53 +0000 (02:55 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Mon, 19 Dec 2016 02:55:53 +0000 (02:55 +0000)
Differential Revision: https://reviews.llvm.org/D27909

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290075 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenObjC/nullptr-assert.m [new file with mode: 0644]

diff --git a/test/CodeGenObjC/nullptr-assert.m b/test/CodeGenObjC/nullptr-assert.m
new file mode 100644 (file)
index 0000000..06e50db
--- /dev/null
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -Wno-objc-root-class -o /dev/null -triple x86_64-- -emit-llvm %s
+// REQUIRES: asserts
+// Verify there is no assertion.
+
+@interface A
+@end
+
+extern A *a;
+
+@interface X
+@end
+
+@implementation X
+
+-(void)test {
+  struct S {
+    A *a;
+    int b;
+  };
+  struct S s[] = {{a, 0}, {(void *)0, 0}};
+}
+@end