From 0104d12cd419be03453637ae0433298dcefc8e7d Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Thu, 19 Dec 2013 23:05:40 +0000 Subject: [analyzer] Fix test in previous commit to account for compiler warning. --analyze passes -w, but -cc1 -analyze doesn't. Oops! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197741 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Analysis/casts.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/Analysis/casts.cpp') diff --git a/test/Analysis/casts.cpp b/test/Analysis/casts.cpp index 763f942ede..53e1cd085a 100644 --- a/test/Analysis/casts.cpp +++ b/test/Analysis/casts.cpp @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s -// expected-no-diagnostics bool PR14634(int x) { double y = (double)x; @@ -12,8 +11,13 @@ bool PR14634_implicit(int x) { } void intAsBoolAsSwitchCondition(int c) { - switch ((bool)c) { + switch ((bool)c) { // expected-warning {{switch condition has boolean value}} case 0: break; } + + switch ((int)(bool)c) { // no-warning + case 0: + break; + } } -- cgit v1.2.1