[cfe-commits] r56295 - /cfe/trunk/test/Analysis/CFNumber.c
Ted Kremenek
kremenek at apple.com
Wed Sep 17 17:28:24 PDT 2008
Author: kremenek
Date: Wed Sep 17 19:28:23 2008
New Revision: 56295
URL: http://llvm.org/viewvc/llvm-project?rev=56295&view=rev
Log:
Added CFNumberCreate test case to illustrate a 32-bit/64-bit arch issue.
Modified:
cfe/trunk/test/Analysis/CFNumber.c
Modified: cfe/trunk/test/Analysis/CFNumber.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/CFNumber.c?rev=56295&r1=56294&r2=56295&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/CFNumber.c (original)
+++ cfe/trunk/test/Analysis/CFNumber.c Wed Sep 17 19:28:23 2008
@@ -1,4 +1,4 @@
-// RUN: clang -checker-cfref -verify %s
+// RUN: clang -checker-cfref -verify -triple x86_64-apple-darwin9 %s
typedef signed long CFIndex;
typedef const struct __CFAllocator * CFAllocatorRef;
@@ -26,3 +26,7 @@
uint16_t x = 1;
return CFNumberCreate(0, kCFNumberSInt8Type, &x); // expected-warning{{A 16 bit integer is used to initialize a CFNumber object that represents an 8 bit integer. 8 bits of the input integer will be lost.}}
}
+
+CFNumberRef f3(unsigned i) {
+ return CFNumberCreate(0, kCFNumberLongType, &i); // expected-warning{{A 32 bit integer is used to initialize a CFNumber object that represents a 64 bit integer.}}
+}
\ No newline at end of file
More information about the cfe-commits
mailing list