12d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines// Regression test:
22d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines// https://code.google.com/p/address-sanitizer/issues/detail?id=257
32d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines// RUN: %clangxx_lsan %s -o %t && %run %t 2>&1 | FileCheck %s
42d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines
52d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines#include <stdio.h>
62d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines
72d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hinesstruct T {
82d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines  ~T() { printf("~T\n"); }
92d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines};
102d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines
112d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen HinesT *t;
122d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines
132d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hinesint main(int argc, char **argv) {
142d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines  t = new T[argc - 1];
152d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines  printf("OK\n");
162d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines}
172d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines
182d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines// CHECK: OK
192d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines
20