[PATCH] D22588: [compiler-rt] Fix broken unittest related to 64-bit print format

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 13:57:11 PDT 2016


etienneb updated this revision to Diff 64755.
etienneb added a comment.

fix an other test


https://reviews.llvm.org/D22588

Files:
  test/asan/TestCases/debug_mapping.cc
  test/asan/TestCases/debug_stacks.cc

Index: test/asan/TestCases/debug_stacks.cc
===================================================================
--- test/asan/TestCases/debug_stacks.cc
+++ test/asan/TestCases/debug_stacks.cc
@@ -8,6 +8,7 @@
 #include <sanitizer/asan_interface.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <inttypes.h>
 
 char *mem;
 void func1() {
@@ -35,9 +36,9 @@
   // CHECK: alloc stack retval ok
   fprintf(stderr, "thread id = %d\n", thread_id);
   // CHECK: thread id = 0
-  fprintf(stderr, "0x%lx\n", trace[0]);
+  fprintf(stderr, "0x%" PRIXPTR "\n", trace[0]);
   // CHECK: [[ALLOC_FRAME_0:0x[0-9a-f]+]]
-  fprintf(stderr, "0x%lx\n", trace[1]);
+  fprintf(stderr, "0x%" PRIXPTR "\n", trace[1]);
   // CHECK: [[ALLOC_FRAME_1:0x[0-9a-f]+]]
 
   num_frames = 100;
@@ -48,9 +49,9 @@
   // CHECK: free stack retval ok
   fprintf(stderr, "thread id = %d\n", thread_id);
   // CHECK: thread id = 0
-  fprintf(stderr, "0x%lx\n", trace[0]);
+  fprintf(stderr, "0x%" PRIXPTR "\n", trace[0]);
   // CHECK: [[FREE_FRAME_0:0x[0-9a-f]+]]
-  fprintf(stderr, "0x%lx\n", trace[1]);
+  fprintf(stderr, "0x%" PRIXPTR "\n", trace[1]);
   // CHECK: [[FREE_FRAME_1:0x[0-9a-f]+]]
 
   mem[0] = 'A'; // BOOM
Index: test/asan/TestCases/debug_mapping.cc
===================================================================
--- test/asan/TestCases/debug_mapping.cc
+++ test/asan/TestCases/debug_mapping.cc
@@ -15,7 +15,7 @@
   __asan_get_shadow_mapping(&scale, &offset);
 
   fprintf(stderr, "scale: %d\n", (int)scale);
-  fprintf(stderr, "offset: 0x%lx\n", offset);
+  fprintf(stderr, "offset: 0x%zx\n", offset);
 
   // CHECK: scale: [[SCALE]]
   // CHECK: offset: [[OFFSET]]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22588.64755.patch
Type: text/x-patch
Size: 1651 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160720/3020f86c/attachment.bin>


More information about the llvm-commits mailing list