From 7d69588d61629cde4c0c605cbf42bdb975974952 Mon Sep 17 00:00:00 2001 From: Yaxun Liu Date: Mon, 19 Dec 2016 02:55:53 +0000 Subject: [PATCH] Add a lit test for PR31374 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 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/CodeGenObjC/nullptr-assert.m diff --git a/test/CodeGenObjC/nullptr-assert.m b/test/CodeGenObjC/nullptr-assert.m new file mode 100644 index 0000000000..06e50db35c --- /dev/null +++ b/test/CodeGenObjC/nullptr-assert.m @@ -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 -- 2.40.0