aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/conversion.c
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-11 18:52:49 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-11 18:52:49 +0000
commitfb6289aac127b3752a5ebedfe05ba30dfee387f5 (patch)
tree8c5a3299f0b60f3b4faaf4e302bd8eaeee718e1d /test/Sema/conversion.c
parentbac727110b58f2e9dc28581d6870843e71ae9b8f (diff)
Test case for warnings with carets inside macro instantiations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/conversion.c')
-rw-r--r--test/Sema/conversion.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Sema/conversion.c b/test/Sema/conversion.c
index 5f20c47ba4..7441a09c06 100644
--- a/test/Sema/conversion.c
+++ b/test/Sema/conversion.c
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wconversion -triple x86_64-apple-darwin %s -Wno-unreachable-code
+#include <limits.h>
+
#define BIG 0x7f7f7f7f7f7f7f7fL
void test0(char c, short s, int i, long l, long long ll) {
@@ -271,3 +273,9 @@ unsigned char test19(unsigned long u64) {
unsigned char x3 = u64 & mask;
return x1 + x2 + x3;
}
+
+// <rdar://problem/7631400>
+void test_7631400(void) {
+ // This should show up despite the caret being inside a macro substitution
+ char s = LONG_MAX; // expected-warning {{implicit cast loses integer precision: 'long' to 'char'}}
+}