[compiler-rt] r373642 - [compiler-rt] More optimization levels in signal_line.cpp test

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 11:18:35 PDT 2019


Author: vitalybuka
Date: Thu Oct  3 11:18:35 2019
New Revision: 373642

URL: http://llvm.org/viewvc/llvm-project?rev=373642&view=rev
Log:
[compiler-rt] More optimization levels in signal_line.cpp test

Modified:
    compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_line.cpp

Modified: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_line.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_line.cpp?rev=373642&r1=373641&r2=373642&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_line.cpp (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_line.cpp Thu Oct  3 11:18:35 2019
@@ -3,8 +3,18 @@
 // RUN: %clangxx %s -o %t -O0
 // RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 1 2>&1 | FileCheck --check-prefixes=CHECK1,CHECK %s
 // RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 2 2>&1 | FileCheck --check-prefixes=CHECK2,CHECK %s
-// RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 3 2>&1 | FileCheck --check-prefixes=CHECK3,CHECK %s
-// RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 4 2>&1 | FileCheck --check-prefixes=CHECK4,CHECK %s
+
+// RUN: %clangxx %s -o %t -O1
+// RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 1 2>&1 | FileCheck --check-prefixes=CHECK1,CHECK %s
+// RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 2 2>&1 | FileCheck --check-prefixes=CHECK2,CHECK %s
+
+// RUN: %clangxx %s -o %t -O2
+// RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 1 2>&1 | FileCheck --check-prefixes=CHECK1,CHECK %s
+// RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 2 2>&1 | FileCheck --check-prefixes=CHECK2,CHECK %s
+
+// RUN: %clangxx %s -o %t -O3
+// RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 1 2>&1 | FileCheck --check-prefixes=CHECK1,CHECK %s
+// RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 2 2>&1 | FileCheck --check-prefixes=CHECK2,CHECK %s
 
 #include <cstdio>
 #include <string>
@@ -20,17 +30,8 @@ int main(int argc, char **argv) {
   // CHECK1: SUMMARY: [[SAN]]: SEGV {{.*}}signal_line.cpp:[[@LINE-2]]:[[TAB]] in main
 
   if (n == 2)
-    *((volatile int *)0x0) = __LINE__;
+    *((volatile int *)0x1) = __LINE__;
   // CHECK2: #{{[0-9]+ .*}}main {{.*}}signal_line.cpp:[[@LINE-1]]:[[TAB:[0-9]+]]
   // CHECK2: SUMMARY: [[SAN]]: SEGV {{.*}}signal_line.cpp:[[@LINE-2]]:[[TAB]] in main
 
-  if (n == 3)
-    *((volatile int *)0x0) = __LINE__;
-  // CHECK3: #{{[0-9]+ .*}}main {{.*}}signal_line.cpp:[[@LINE-1]]:[[TAB:[0-9]+]]
-  // CHECK3: SUMMARY: [[SAN]]: SEGV {{.*}}signal_line.cpp:[[@LINE-2]]:[[TAB]] in main
-
-  if (n == 4)
-    *((volatile int *)0x0) = __LINE__;
-  // CHECK4: #{{[0-9]+ .*}}main {{.*}}signal_line.cpp:[[@LINE-1]]:[[TAB:[0-9]+]]
-  // CHECK4: SUMMARY: [[SAN]]: SEGV {{.*}}signal_line.cpp:[[@LINE-2]]:[[TAB]] in main
 }




More information about the llvm-commits mailing list