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

llvm-svn: 290075

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

diff --git a/clang/test/CodeGenObjC/nullptr-assert.m b/clang/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