mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 11:16:07 +00:00

It's very flaky recently. 10 bulds are OK, then 3 failed: https://lab.llvm.org/buildbot/#/builders/52/builds/1524 https://lab.llvm.org/buildbot/#/builders/52/builds/1525 https://lab.llvm.org/buildbot/#/builders/52/builds/1526 then 3 OK https://lab.llvm.org/buildbot/#/builders/52/builds/1531 https://lab.llvm.org/buildbot/#/builders/52/builds/1532 then 2 green again We need to stop to spam blame list by disabling the test, and investigate later if Asan is valuable for the test. Issue #102858
36 lines
1.0 KiB
C++
36 lines
1.0 KiB
C++
// UNSUPPORTED: system-aix, system-zos
|
|
// see https://github.com/llvm/llvm-project/issues/68092
|
|
// XFAIL: host={{.*}}-windows-msvc
|
|
|
|
// The test is flaky with asan https://github.com/llvm/llvm-project/issues/102858.
|
|
// UNSUPPORTED: asan
|
|
|
|
// RUN: cat %s | clang-repl | FileCheck %s
|
|
// RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s
|
|
|
|
extern "C" int printf(const char*, ...);
|
|
|
|
struct A { int val; A(int v); ~A(); void f() const; };
|
|
A::A(int v) : val(v) { printf("A(%d), this = %p\n", val, this); }
|
|
A::~A() { printf("~A, this = %p, val = %d\n", this, val); }
|
|
void A::f() const { printf("f: this = %p, val = %d\n", this, val); }
|
|
|
|
const A a(1);
|
|
// CHECK: A(1), this = [[THIS:.+]]
|
|
// The constructor must only be called once!
|
|
// CHECK-NOT: A(1)
|
|
|
|
a.f();
|
|
// CHECK-NEXT: f: this = [[THIS]], val = 1
|
|
a.f();
|
|
// CHECK-NEXT: f: this = [[THIS]], val = 1
|
|
|
|
%quit
|
|
// There must still be no other constructor!
|
|
// CHECK-NOT: A(1)
|
|
|
|
// At the end, we expect exactly one destructor call
|
|
// CHECK: ~A
|
|
// CHECK-SAME: this = [[THIS]], val = 1
|
|
// CHECK-NOT: ~A
|