aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/fold-const-declref.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/fold-const-declref.c')
-rw-r--r--test/CodeGen/fold-const-declref.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGen/fold-const-declref.c b/test/CodeGen/fold-const-declref.c
new file mode 100644
index 000000000000..5a7ba8e26a77
--- /dev/null
+++ b/test/CodeGen/fold-const-declref.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -verify -emit-llvm-only
+
+// PR7242: Check that this doesn't crash.
+int main(void)
+{
+ int __negative = 1;
+ const int __max = __negative && 0 ;
+ __max / 0;
+}