]> granicus.if.org Git - clang/commitdiff
[analyzer] Adjust ptr arithmetic test
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Mon, 28 Aug 2017 22:58:54 +0000 (22:58 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Mon, 28 Aug 2017 22:58:54 +0000 (22:58 +0000)
Replace "long" with __UINTPTR_TYPE__
to make the test added in rL311935 Windows-friendly.
Caught by the buildbot llvm-clang-x86_64-expensive-checks-win.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311947 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/ptr-arith.cpp

index f546d5ae7cb3f1c20430d63acb948c2c4154fb6f..01adf476e4f950fb580f44128d9bc9c486992534 100644 (file)
@@ -107,7 +107,7 @@ unsigned ptrSubtractionNoCrash(char *Begin, char *End) {
 }
 
 // Bug 34309
-bool ptrAsIntegerSubtractionNoCrash(long x, char *p) {
-  long y = (long)p - 1;
+bool ptrAsIntegerSubtractionNoCrash(__UINTPTR_TYPE__ x, char *p) {
+  __UINTPTR_TYPE__ y = (__UINTPTR_TYPE__)p - 1;
   return y == x;
 }