summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2010-09-06 00:10:32 +0000
committerEli Friedman <eli.friedman@gmail.com>2010-09-06 00:10:32 +0000
commit0b1fbd139418d1afbe10cf60a9a85a3cc090aa56 (patch)
tree6fd5c867ad3b7ad0d56dd4195c73b150a0e4971c /clang/test/CodeGen
parentee8df8f1678de51cfc38014c61dc0624805bbe0a (diff)
downloadbcm5719-llvm-0b1fbd139418d1afbe10cf60a9a85a3cc090aa56.tar.gz
bcm5719-llvm-0b1fbd139418d1afbe10cf60a9a85a3cc090aa56.zip
PR7242: Make sure to use a different context for evaluating constant
initializers, so the result of the evaluation doesn't leak through inconsistently. Also, don't evaluate references to variables with initializers with side-effects. llvm-svn: 113128
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/fold-const-declref.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGen/fold-const-declref.c b/clang/test/CodeGen/fold-const-declref.c
new file mode 100644
index 00000000000..5a7ba8e26a7
--- /dev/null
+++ b/clang/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;
+}
OpenPOWER on IntegriCloud