diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:52:19 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:52:19 +0000 |
| commit | 5c909fa013fc285f010a95e8d387e0ef3412da9c (patch) | |
| tree | 1059d068ad281f4776ff44cd414574f99a460023 /test/asan/TestCases/Linux/init_fini_sections.cc | |
| parent | f31bcc68c72371a2bf63aead9f3373a1ff2053b6 (diff) | |
Notes
Diffstat (limited to 'test/asan/TestCases/Linux/init_fini_sections.cc')
| -rw-r--r-- | test/asan/TestCases/Linux/init_fini_sections.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/asan/TestCases/Linux/init_fini_sections.cc b/test/asan/TestCases/Linux/init_fini_sections.cc new file mode 100644 index 000000000000..c7234eeeac2c --- /dev/null +++ b/test/asan/TestCases/Linux/init_fini_sections.cc @@ -0,0 +1,24 @@ +// RUN: %clangxx_asan %s -o %t && %run %t | FileCheck %s + +#include <stdio.h> + +static void foo() { + printf("foo\n"); +} + +int main() { + return 0; +} + +__attribute__((section(".preinit_array"))) +void (*call_foo)(void) = &foo; + +__attribute__((section(".init_array"))) +void (*call_foo_2)(void) = &foo; + +__attribute__((section(".fini_array"))) +void (*call_foo_3)(void) = &foo; + +// CHECK: foo +// CHECK: foo +// CHECK: foo |
