From 739908faf62f3b076bd9714c65f84a350246d600 Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 11 Feb 2010 18:52:49 +0000 Subject: [PATCH] Test case for warnings with carets inside macro instantiations. llvm-svn: 95893 --- clang/test/Sema/conversion.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/clang/test/Sema/conversion.c b/clang/test/Sema/conversion.c index 5f20c47ba4c9..7441a09c064e 100644 --- a/clang/test/Sema/conversion.c +++ b/clang/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 + #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; } + +// +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'}} +}