[compiler-rt] ab8a460 - [asan][test] Handle Solaris in large_func_test.cpp etc.

Rainer Orth via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 5 16:30:58 PST 2021


Author: Rainer Orth
Date: 2021-03-06T01:28:17+01:00
New Revision: ab8a46024157b4d042ea6325710bbccd598adcfc

URL: https://github.com/llvm/llvm-project/commit/ab8a46024157b4d042ea6325710bbccd598adcfc
DIFF: https://github.com/llvm/llvm-project/commit/ab8a46024157b4d042ea6325710bbccd598adcfc.diff

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

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`.

Differential Revision: https://reviews.llvm.org/D97931

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/large_func_test.cpp b/compiler-rt/test/asan/TestCases/large_func_test.cpp
index 1fbed41130df..9c8e28b9ebef 100644
--- a/compiler-rt/test/asan/TestCases/large_func_test.cpp
+++ b/compiler-rt/test/asan/TestCases/large_func_test.cpp
@@ -25,8 +25,9 @@ static void LargeFunction(int *x, int zero) {
   // 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 @@ int main(int argc, char **argv) {
   // 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;
 }

diff  --git a/compiler-rt/test/asan/TestCases/use-after-delete.cpp b/compiler-rt/test/asan/TestCases/use-after-delete.cpp
index 33703600e998..14b14256c1df 100644
--- a/compiler-rt/test/asan/TestCases/use-after-delete.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-delete.cpp
@@ -17,15 +17,17 @@ int main() {
 
   // 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):


        


More information about the llvm-commits mailing list