[compiler-rt] r270631 - [esan|cfrag] Add test struct-simple.cpp
Derek Bruening via llvm-commits
llvm-commits at lists.llvm.org
Tue May 24 16:03:52 PDT 2016
Author: bruening
Date: Tue May 24 18:03:52 2016
New Revision: 270631
URL: http://llvm.org/viewvc/llvm-project?rev=270631&view=rev
Log:
[esan|cfrag] Add test struct-simple.cpp
Summary: Adds a new test struct-simple.cpp for testing the
cache-fragmentation tool with a multi-compilation-unit application.
Patch by Qin Zhao.
Reviewers: bruening
Subscribers: kubabrecka, kcc, vitalybuka, eugenis, aizatsky, llvm-commits, zhaoqin
Differential Revision: http://reviews.llvm.org/D20599
Added:
compiler-rt/trunk/test/esan/TestCases/struct-simple.cpp (with props)
Added: compiler-rt/trunk/test/esan/TestCases/struct-simple.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/esan/TestCases/struct-simple.cpp?rev=270631&view=auto
==============================================================================
--- compiler-rt/trunk/test/esan/TestCases/struct-simple.cpp (added)
+++ compiler-rt/trunk/test/esan/TestCases/struct-simple.cpp Tue May 24 18:03:52 2016
@@ -0,0 +1,38 @@
+// RUN: %clang_esan_frag -O0 %s -DPART -c -o %t-part.o 2>&1
+// RUN: %clang_esan_frag -O0 %s -DMAIN -c -o %t-main.o 2>&1
+// RUN: %clang_esan_frag -O0 %t-part.o %t-main.o -o %t 2>&1
+// RUN: %env_esan_opts=verbosity=2 %run %t 2>&1 | FileCheck %s
+
+// We generate two different object files from this file with different
+// macros, and then link them together. We do this to test how we handle
+// separate compilation with multiple compilation units.
+
+#include <stdio.h>
+
+extern "C" {
+ void part();
+}
+
+//===-- compilation unit without main function ----------------------------===//
+
+#ifdef PART
+void part()
+{
+}
+#endif // PART
+
+//===-- compilation unit with main function -------------------------------===//
+
+#ifdef MAIN
+int main(int argc, char **argv) {
+ // CHECK: in esan::initializeLibrary
+ // CHECK: in esan::processCompilationUnitInit
+ // CHECK: in esan::processCompilationUnitInit
+ part();
+ return 0;
+ // CHECK-NEXT: in esan::finalizeLibrary
+ // CHECK-NEXT: {{.*}}EfficiencySanitizer is not finished: nothing yet to report
+ // CHECK: in esan::processCompilationUnitExit
+ // CHECK: in esan::processCompilationUnitExit
+}
+#endif // MAIN
Propchange: compiler-rt/trunk/test/esan/TestCases/struct-simple.cpp
------------------------------------------------------------------------------
svn:eol-style = LF
More information about the llvm-commits
mailing list