brintos

brintos / llvm-project-archived public Read only

0
0
Text · 433 B · 6946e50 Raw
21 lines · cpp
1// RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s2// RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s3 4#ifndef _GNU_SOURCE5#define _GNU_SOURCE6#endif7 8#include <stdio.h>9#include <stdlib.h>10 11int main(int argc, char **argv) {12  char *p;13  int res = asprintf(&p, "%d", argc);14  fprintf(stderr, "x%d %sx\n", res, p);15  // CHECK: x1 1x16  free(p);17  fprintf(stderr, "DONE\n");18  // CHECK: DONE19  return 0;20}21