[cfe-commits] r95893 - /cfe/trunk/test/Sema/conversion.c

John McCall rjmccall at apple.com
Thu Feb 11 10:52:50 PST 2010


Author: rjmccall
Date: Thu Feb 11 12:52:49 2010
New Revision: 95893

URL: http://llvm.org/viewvc/llvm-project?rev=95893&view=rev
Log:
Test case for warnings with carets inside macro instantiations.


Modified:
    cfe/trunk/test/Sema/conversion.c

Modified: cfe/trunk/test/Sema/conversion.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/conversion.c?rev=95893&r1=95892&r2=95893&view=diff

==============================================================================
--- cfe/trunk/test/Sema/conversion.c (original)
+++ cfe/trunk/test/Sema/conversion.c Thu Feb 11 12:52:49 2010
@@ -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 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'}}
+}





More information about the cfe-commits mailing list