[PATCH] D97931: [asan][test] Handle Solaris in large_func_test.cpp etc.

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 04:10:00 PST 2021


ro created this revision.
ro added a reviewer: vitalybuka.
ro added a project: Sanitizers.
Herald added subscribers: pengfei, fedor.sergeev.
ro requested review of this revision.
Herald added a subscriber: Sanitizers.

Two ASan tests currently `FAIL' on Solaris

  AddressSanitizer-i386-sunos :: TestCases/large_func_test.cpp
  AddressSanitizer-i386-sunos :: TestCases/use-after-delete.cpp

both for the same reason:

  error: no check strings found with prefix 'CHECK-SunOS:'

Fixed by adding the appropriate check strings.

Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97931

Files:
  compiler-rt/test/asan/TestCases/large_func_test.cpp
  compiler-rt/test/asan/TestCases/use-after-delete.cpp


Index: compiler-rt/test/asan/TestCases/use-after-delete.cpp
===================================================================
--- compiler-rt/test/asan/TestCases/use-after-delete.cpp
+++ compiler-rt/test/asan/TestCases/use-after-delete.cpp
@@ -17,15 +17,17 @@
 
   // CHECK: {{freed by thread T0 here:}}
   // CHECK-Linux:  {{    #0 0x.* in operator delete\[\]}}
+  // CHECK-SunOS:  {{    #0 0x.* in operator delete\[\]}}
   // CHECK-Windows:{{    #0 0x.* in operator delete\[\]}}
   // CHECK-Darwin: {{    #0 0x.* in .*_Zda}}
-  // CHECK: {{    #1 0x.* in main .*use-after-delete.cpp:}}[[@LINE-12]]
+  // CHECK: {{    #1 0x.* in main .*use-after-delete.cpp:}}[[@LINE-13]]
 
   // CHECK: {{previously allocated by thread T0 here:}}
   // CHECK-Linux:  {{    #0 0x.* in operator new\[\]}}
+  // CHECK-SunOS:  {{    #0 0x.* in operator new\[\]}}
   // CHECK-Windows:{{    #0 0x.* in operator new\[\]}}
   // CHECK-Darwin: {{    #0 0x.* in .*_Zna}}
-  // CHECK:        {{    #1 0x.* in main .*use-after-delete.cpp:}}[[@LINE-19]]
+  // CHECK:        {{    #1 0x.* in main .*use-after-delete.cpp:}}[[@LINE-21]]
 
 
   // CHECK: Shadow byte legend (one shadow byte represents {{[0-9]+}} application bytes):
Index: compiler-rt/test/asan/TestCases/large_func_test.cpp
===================================================================
--- compiler-rt/test/asan/TestCases/large_func_test.cpp
+++ compiler-rt/test/asan/TestCases/large_func_test.cpp
@@ -25,8 +25,9 @@
   // atos incorrectly extracts the symbol name for the static functions on
   // Darwin.
   // CHECK-Linux:  {{#0 0x.* in LargeFunction.*large_func_test.cpp:}}[[@LINE-3]]
-  // CHECK-Windows:{{#0 0x.* in LargeFunction.*large_func_test.cpp:}}[[@LINE-4]]
-  // CHECK-Darwin: {{#0 0x.* in .*LargeFunction.*large_func_test.cpp}}:[[@LINE-5]]
+  // CHECK-SunOS:  {{#0 0x.* in LargeFunction.*large_func_test.cpp:}}[[@LINE-4]]
+  // CHECK-Windows:{{#0 0x.* in LargeFunction.*large_func_test.cpp:}}[[@LINE-5]]
+  // CHECK-Darwin: {{#0 0x.* in .*LargeFunction.*large_func_test.cpp}}:[[@LINE-6]]
 
   x[10]++;
   x[11]++;
@@ -47,8 +48,9 @@
   // CHECK: {{0x.* is located 12 bytes to the right of 400-byte region}}
   // CHECK: {{allocated by thread T0 here:}}
   // CHECK-Linux:  {{    #0 0x.* in operator new}}
+  // CHECK-SunOS:  {{    #0 0x.* in operator new}}
   // CHECK-Windows:{{    #0 0x.* in operator new}}
   // CHECK-Darwin: {{    #0 0x.* in .*_Zna}}
-  // CHECK: {{    #1 0x.* in main .*large_func_test.cpp:}}[[@LINE-8]]
+  // CHECK: {{    #1 0x.* in main .*large_func_test.cpp:}}[[@LINE-9]]
   delete[] x;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97931.328119.patch
Type: text/x-patch
Size: 2572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210304/49198f39/attachment.bin>


More information about the llvm-commits mailing list