[InstCombine] Preserve NSW flags for `lshr (mul nuw X, C1), C2 -> mul nuw nsw X,...
[llvm-project.git] / clang / test / CodeGenCXX / destructor-calls.cpp
blob4da46a4358a6f4233cb2825b22d99b6bfacd60c3
1 // RUN: %clang_cc1 %s -emit-llvm -o %t
3 extern "C" int printf(...);
5 static int val;
7 struct B {
8 B() : iB(++val) { printf("B()\n"); }
9 int iB;
10 ~B() { printf("~B(%d)\n", iB); --val; }
13 struct M : B {
14 M() : iM(++val) { printf("M()\n"); }
15 int iM;
16 ~M() { printf("~M(%d)\n", iM); --val; }
19 struct P {
20 P() : iP(++val) { printf("P()\n"); }
21 int iP;
22 ~P() { printf("~P(%d)\n", iP); --val; }
25 struct N : M, P {
26 N() { printf("N()\n"); iN = ++val; }
27 ~N() { printf("~N(%d) val = %d\n", iN, --val); }
28 int iN;
29 M m;
30 P p;
33 struct O : B {
34 ~O() { return; }
37 int main() {
38 N n1;
39 N n2;
40 O o;