brintos

brintos / llvm-project-archived public Read only

0
0
Text · 484 B · 5fa5945 Raw
20 lines · cpp
1// If we have LLD, see that things more or less work.2//3// REQUIRES: lld-available4//5// RUN: %clangxx_asan -O2 %s -o %t.exe -g -gcodeview -fuse-ld=lld -Wl,-debug6// RUN: not %run %t.exe 2>&1 | FileCheck %s7 8#include <stdlib.h>9 10int main() {11  char *x = (char*)malloc(10 * sizeof(char));12  free(x);13  return x[5];14  // CHECK: heap-use-after-free15  // CHECK: free16  // CHECK: main{{.*}}fuse-lld.cpp:[[@LINE-4]]:317  // CHECK: malloc18  // CHECK: main{{.*}}fuse-lld.cpp:[[@LINE-7]]:2019}20