From 6f8f15fa72623257d03eb8e742552d16f5e4a304 Mon Sep 17 00:00:00 2001 From: Vlad Tsyrklevich Date: Wed, 6 Jun 2018 06:09:02 +0000 Subject: [Analyzer] Fix Z3ConstraintManager crash (PR37646) Summary: Fix another Z3ConstraintManager crash, use fixAPSInt() to extend a boolean APSInt. Reviewers: george.karpenkov, NoQ, ddcc Reviewed By: george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D47617 llvm-svn: 334065 --- clang/test/Analysis/z3/apsint.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 clang/test/Analysis/z3/apsint.c (limited to 'clang/test/Analysis/z3/apsint.c') diff --git a/clang/test/Analysis/z3/apsint.c b/clang/test/Analysis/z3/apsint.c new file mode 100644 index 00000000000..670ef2be1c5 --- /dev/null +++ b/clang/test/Analysis/z3/apsint.c @@ -0,0 +1,16 @@ +// RUN: %clang_analyze_cc1 -triple x86_64-unknown-linux-gnu -analyzer-checker=core -verify %s +// expected-no-diagnostics + +// https://bugs.llvm.org/show_bug.cgi?id=37622 +_Bool a() { + return !({ a(); }); +} + +// https://bugs.llvm.org/show_bug.cgi?id=37646 +_Bool b; +void c() { + _Bool a = b | 0; + for (;;) + if (a) + ; +} -- cgit v1.2.3