view gcc/testsuite/c-c++-common/asan/force-inline-opt0-1.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* This test checks that we are no instrumenting a memory access twice
   (before and after inlining) */

/* { dg-do compile } */
/* { dg-options "-fno-sanitize-address-use-after-scope" } */
/* { dg-final { scan-assembler-not "__asan_report_load" } } */

__attribute__((always_inline))
inline void foo(int *x) {
  *x = 0;
}

int main() {
  int x;
  foo(&x);
  return x;
}