summaryrefslogtreecommitdiff
path: root/test/Sema/compare.c
diff options
context:
space:
mode:
authorDavid Bolvansky <david.bolvansky@gmail.com>2019-04-29 23:24:00 +0000
committerDavid Bolvansky <david.bolvansky@gmail.com>2019-04-29 23:24:00 +0000
commit6eedd8523a8d0f6c4deb0a240408270ce850b59b (patch)
tree3bbb1f3664cef6b83b35c18b23af95955c69b3c4 /test/Sema/compare.c
parent887ff701b7382dfa758099f6fb8fccc665e54384 (diff)
downloadclang-6eedd8523a8d0f6c4deb0a240408270ce850b59b.tar.gz
[Diagnostics] Support -Wtype-limits for GCC compatibility
Summary: GCC's -Wtype-limits (part of -Wextra): Warn if a comparison is always true or always false due to the limited range of the data type Reviewers: rsmith, aaron.ballman, lebedev.ri, thakis Reviewed By: rsmith Subscribers: lebedev.ri, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58841 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/compare.c')
-rw-r--r--test/Sema/compare.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/Sema/compare.c b/test/Sema/compare.c
index b2b486f59f..25aa13f6ba 100644
--- a/test/Sema/compare.c
+++ b/test/Sema/compare.c
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -Wtautological-constant-in-range-compare %s -Wno-unreachable-code
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -Wtype-limits %s -Wno-unreachable-code
int test(char *C) { // nothing here should warn.
return C != ((void*)0);