// 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

Add test for .preinit_array/.init_array/.fini_array sections.
[ASan] Add test for .preinit_array/.init_array/.fini_array sections.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@247737 91177308-0d34-0410-b5e6-96231b3b80d8
