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