xref: /llvm-project/clang/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp (revision c2985a330cd5c418488cbd87bd7a2922d6a8f7da)
1 // RUN: %clang_cc1 -std=c++11 -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
2 
3 struct A {
AA4   constexpr A(int x) : x(x) {}
5   virtual void f();
6   int x;
7 };
8 
9 A a(42);
10 // CHECK: @"?a@@3UA@@A" = dso_local global %struct.A { ptr @"??_7A@@6B@", i32 42 }, align 4
11 
12 struct B {
BB13   constexpr B(int y) : y(y) {}
14   virtual void g();
15   int y;
16 };
17 
18 struct C : A, B {
CC19   constexpr C() : A(777), B(13) {}
20 };
21 
22 C c;
23 // CHECK: @"?c@@3UC@@A" = dso_local global { ptr, i32, ptr, i32 } { ptr @"??_7C@@6BA@@@", i32 777, ptr @"??_7C@@6BB@@@", i32 13 }
24