summaryrefslogtreecommitdiff
path: root/test/CodeGen/2011-03-31-ArrayRefFolding.c
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-07-26 00:57:50 +0000
committerEric Christopher <echristo@apple.com>2011-07-26 00:57:50 +0000
commita11d129aa8ad9fa123e72d0663c327d5578d2602 (patch)
treeee5b20607116da207692eb151cf348c1a5c59fda /test/CodeGen/2011-03-31-ArrayRefFolding.c
parent5485ac0bbef7c9f868df3c557383613636549bf4 (diff)
downloadclang-a11d129aa8ad9fa123e72d0663c327d5578d2602.tar.gz
Migrate and FileCheck-ize some of:
2003-09-18-BitfieldTests.c 2007-04-11-PR1321.c 2003-11-13-TypeSafety.c 2003-08-29-StructLayoutBug.c 2010-05-14-Optimized-VarType.c 2003-10-06-NegateExprType.c 2007-06-05-NoInlineAttribute.c 2011-03-31-ArrayRefFolding.c 2010-07-14-ref-off-end.c Atomics-no64bit.c 2007-05-11-str-const.c 2004-11-27-InvalidConstantExpr.c 2007-04-05-UnPackedStruct.c 2004-03-15-SimpleIndirectGoto.c 2004-01-08-ExternInlineRedefine.c sret2.c 2007-02-07-AddrLabel.c 2002-09-19-StarInLabel.c 2003-11-16-StaticArrayInit.c 2003-08-18-SigSetJmp.c 2007-04-24-VolatileStructCopy.c 2002-07-29-Casts.c 2005-06-15-ExpandGotoInternalProblem.c 2007-09-17-WeakRef.c 2007-04-24-str-const.c 2003-08-30-LargeIntegerBitfieldMember.c inline-asm-mrv.c from llvm/test/FrontendC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/2011-03-31-ArrayRefFolding.c')
-rw-r--r--test/CodeGen/2011-03-31-ArrayRefFolding.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/2011-03-31-ArrayRefFolding.c b/test/CodeGen/2011-03-31-ArrayRefFolding.c
new file mode 100644
index 0000000000..3fc5e5af31
--- /dev/null
+++ b/test/CodeGen/2011-03-31-ArrayRefFolding.c
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -emit-llvm -o - -triple i386-apple-darwin -Os %s | FileCheck %s
+// PR9571
+
+struct t {
+ int x;
+};
+
+extern struct t *cfun;
+
+int f(void) {
+ if (!(cfun + 0))
+ // CHECK: icmp eq %struct.t* %tmp, null
+ return 0;
+ return cfun->x;
+}