[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
[llvm-project.git] / clang / test / CodeGen / union-non-trivial-member.cpp
blobfdc9fd16911e14f3bed233c93ce3a4cdba5b6355
1 // RUN: %clang_cc1 --std=c++17 -emit-llvm %s -o - -triple x86_64-unknown-linux-gnu | FileCheck %s
3 struct non_trivial_constructor {
4 constexpr non_trivial_constructor() : x(100) { }
5 int x;
6 };
8 union UnionInt {
9 int a{1000};
10 non_trivial_constructor b;
13 union UnionNonTrivial {
14 int a;
15 non_trivial_constructor b{};
18 void f() {
19 UnionInt u1;
20 UnionNonTrivial u2;
23 // CHECK: define dso_local void @_Z1fv()
24 // CHECK: call void @_ZN8UnionIntC1Ev
25 // CHECK-NEXT: call void @_ZN15UnionNonTrivialC1Ev
27 // CHECK: define {{.*}}void @_ZN8UnionIntC1Ev
28 // CHECK: call void @_ZN8UnionIntC2Ev
30 // CHECK: define {{.*}}void @_ZN15UnionNonTrivialC1Ev
31 // CHECK: call void @_ZN15UnionNonTrivialC2Ev
33 // CHECK: define {{.*}}void @_ZN8UnionIntC2Ev
34 // CHECK: store i32 1000
36 // CHECK: define {{.*}}void @_ZN15UnionNonTrivialC2Ev
37 // CHECK: call void @_ZN23non_trivial_constructorC1Ev