[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / clang / test / Interpreter / const.cpp
blob52be75e09ade7425cd6e3d6af26c98018d592213
1 // UNSUPPORTED: system-aix, system-zos
2 // see https://github.com/llvm/llvm-project/issues/68092
3 // XFAIL: host={{.*}}-windows-msvc
5 // The test is flaky with asan https://github.com/llvm/llvm-project/issues/102858.
6 // UNSUPPORTED: asan
8 // RUN: cat %s | clang-repl | FileCheck %s
9 // RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s
11 extern "C" int printf(const char*, ...);
13 struct A { int val; A(int v); ~A(); void f() const; };
14 A::A(int v) : val(v) { printf("A(%d), this = %p\n", val, this); }
15 A::~A() { printf("~A, this = %p, val = %d\n", this, val); }
16 void A::f() const { printf("f: this = %p, val = %d\n", this, val); }
18 const A a(1);
19 // CHECK: A(1), this = [[THIS:.+]]
20 // The constructor must only be called once!
21 // CHECK-NOT: A(1)
23 a.f();
24 // CHECK-NEXT: f: this = [[THIS]], val = 1
25 a.f();
26 // CHECK-NEXT: f: this = [[THIS]], val = 1
28 %quit
29 // There must still be no other constructor!
30 // CHECK-NOT: A(1)
32 // At the end, we expect exactly one destructor call
33 // CHECK: ~A
34 // CHECK-SAME: this = [[THIS]], val = 1
35 // CHECK-NOT: ~A