Files
clang-p2996/compiler-rt/test/asan/TestCases/Darwin/empty-section.cc
Kuba Brecka f3a493638f [asan] Fix an OS X startup crash when an empty section is present
On OS X, when the main instrumented binary contains a custom section with zero length, ASan will crash (assert failure) early in the initialization.

Reviewed at http://reviews.llvm.org/D10944

llvm-svn: 241474
2015-07-06 17:17:06 +00:00

13 lines
315 B
C++

// Regression test with an empty (length = 0) custom section.
// RUN: %clangxx_asan -g -O0 %s -c -o %t.o
// RUN: %clangxx_asan -g -O0 %t.o -o %t -sectcreate mysegment mysection /dev/null
// RUN: %run %t 2>&1 | FileCheck %s
#include <stdio.h>
int main() {
printf("Hello, world!\n");
// CHECK: Hello, world!
}