1 /* PR sanitizer/78106 */
2 /* { dg-do compile } */
3 /* { dg-options "-fsanitize=address -fdump-tree-sanopt-details -ffat-lto-objects" } */
4 
5 int *variable;
6 
release()7 void __attribute__((used)) release()
8 {
9   __builtin_free (variable);
10 }
11 
main2(int argc)12 int main2(int argc)
13 {
14   *variable = 2;
15 
16   if (argc <= 5)
17     asm volatile ("call release");
18 
19   *variable = 2;
20   __builtin_abort ();
21 
22   return 0;
23 }
24 
main(int argc,char ** argv)25 int main(int argc, char **argv)
26 {
27   variable = __builtin_malloc (sizeof(int));
28   return main2(argc);
29 }
30 
31 /* { dg-final { scan-tree-dump-not "Optimizing out(\n|\r\n|\r)  ASAN_CHECK \\(7, variable.*" "sanopt" } } */
32