diff --git a/test/FrontendC/2011-03-31-ArrayRefFolding.c b/test/FrontendC/2011-03-31-ArrayRefFolding.c new file mode 100644 index 00000000000..403927931c7 --- /dev/null +++ b/test/FrontendC/2011-03-31-ArrayRefFolding.c @@ -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; +}