forked from OSchip/llvm-project
parent
94bc422d7a
commit
6c3f7fcb8a
|
@ -1,9 +1,11 @@
|
||||||
// Check that --gc-sections does not throw away (or localize) parts of sanitizer
|
// Check that --gc-sections does not throw away (or localize) parts of sanitizer
|
||||||
// interface.
|
// interface.
|
||||||
// RUN: %clang_asan -m64 %s -Wl,--gc-sections -o %t
|
// RUN: %clang_asan %s -Wl,--gc-sections -o %t
|
||||||
// RUN: %clang_asan -m64 %s -DBUILD_SO -fPIC -o %t-so.so -shared
|
// RUN: %clang_asan %s -DBUILD_SO -fPIC -o %t-so.so -shared
|
||||||
// RUN: %t 2>&1
|
// RUN: %t 2>&1
|
||||||
|
|
||||||
|
// REQUIRES: asan-64-bits
|
||||||
|
|
||||||
#ifndef BUILD_SO
|
#ifndef BUILD_SO
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
@ -30,7 +32,7 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
#else // BUILD_SO
|
#else // BUILD_SO
|
||||||
|
|
||||||
#include <sanitizer/msan_interface.h>
|
#include <sanitizer/asan_interface.h>
|
||||||
extern "C" void call_rtl_from_dso() {
|
extern "C" void call_rtl_from_dso() {
|
||||||
volatile int32_t x;
|
volatile int32_t x;
|
||||||
volatile int32_t y = __sanitizer_unaligned_load32((void *)&x);
|
volatile int32_t y = __sanitizer_unaligned_load32((void *)&x);
|
||||||
|
|
Loading…
Reference in New Issue