1 | // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s |
2 | |
3 | // Test the frexpl() interceptor. |
4 | |
5 | // FIXME: MinGW-w64 implements `frexpl()` as a static import, so the dynamic |
6 | // interceptor seems to not work. |
7 | // XFAIL: target={{.*-windows-gnu}} |
8 | |
9 | #include <math.h> |
10 | #include <stdio.h> |
11 | #include <stdlib.h> |
12 | int main() { |
13 | long double x = 3.14; |
14 | int *exp = (int *)malloc(size: sizeof(int)); |
15 | free(ptr: exp); |
16 | double y = frexpl(x: x, exponent: exp); |
17 | // CHECK: use-after-free |
18 | // CHECK: SUMMARY |
19 | return 0; |
20 | } |
21 | |