Testcase for r128619 (PR9571).
authorBill Wendling <isanbard@gmail.com>
Thu, 31 Mar 2011 08:13:57 +0000 (08:13 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 31 Mar 2011 08:13:57 +0000 (08:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128620 91177308-0d34-0410-b5e6-96231b3b80d8

test/FrontendC/2011-03-31-ArrayRefFolding.c [new file with mode: 0644]

diff --git a/test/FrontendC/2011-03-31-ArrayRefFolding.c b/test/FrontendC/2011-03-31-ArrayRefFolding.c
new file mode 100644 (file)
index 0000000..4039279
--- /dev/null
@@ -0,0 +1,15 @@
+// RUN: %llvmgcc -S -o - -m32 -Os %s | FileCheck %s
+// PR9571
+
+struct t {
+  int x;
+};
+
+extern struct t *cfun;
+
+int f(void) {
+  if (!(cfun + 0))
+// CHECK: icmp eq %struct.t* %0, null
+    return 0;
+  return cfun->x;
+}