xref: /llvm-project/compiler-rt/test/asan/TestCases/frexpf_interceptor.cpp (revision cfa4d112da8da97480c3018c68389aa06cb3efb8)
1 // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
2 
3 // Test the frexpf() interceptor.
4 
5 #include <math.h>
6 #include <stdio.h>
7 #include <stdlib.h>
main()8 int main() {
9   float x = 3.14;
10   int *exp = (int *)malloc(sizeof(int));
11   free(exp);
12   double y = frexpf(x, exp);
13   // CHECK: use-after-free
14   // CHECK: SUMMARY
15   return 0;
16 }
17