[PATCH] D20599: [esan|cfrag] Add test struct-simple.cpp

Derek Bruening via llvm-commits llvm-commits at lists.llvm.org
Tue May 24 16:10:25 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL270631: [esan|cfrag] Add test struct-simple.cpp (authored by bruening).

Changed prior to commit:
  http://reviews.llvm.org/D20599?vs=58326&id=58349#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20599

Files:
  compiler-rt/trunk/test/esan/TestCases/struct-simple.cpp

Index: compiler-rt/trunk/test/esan/TestCases/struct-simple.cpp
===================================================================
--- compiler-rt/trunk/test/esan/TestCases/struct-simple.cpp
+++ compiler-rt/trunk/test/esan/TestCases/struct-simple.cpp
@@ -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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20599.58349.patch
Type: text/x-patch
Size: 1477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160524/f5c98556/attachment.bin>


More information about the llvm-commits mailing list