[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGenCXX / mangle-nttp-anon-union.cpp
blob4fd4a51bc3ee18eeee81e18924979a4fe77b8473
1 // RUN: %clang_cc1 -std=c++20 -fclang-abi-compat=latest -emit-llvm %s -o - -triple=x86_64-linux-gnu | FileCheck %s
2 // RUN: %clang_cc1 -std=c++20 -fclang-abi-compat=latest -emit-llvm %s -o - -triple=x86_64-linux-gnu | llvm-cxxfilt -n | FileCheck %s --check-prefix DEMANGLED
4 template<typename T>
5 struct wrapper1 {
6 union {
7 struct {
8 T RightName;
9 };
13 template<typename T>
14 struct wrapper2 {
15 union {
16 struct {
17 T RightName;
19 T WrongName;
23 struct Base {
24 int WrongName;
27 template <typename T>
28 struct wrapper3 {
29 union {
30 struct : Base {
31 T RightName; };
32 T WrongName;
36 template <typename T>
37 struct wrapper4 {
38 union {
39 int RightName;
40 struct {
41 T WrongName;
43 T AlsoWrongName;
47 template <typename T>
48 struct wrapper5 {
49 union {
50 struct {
51 struct {
52 T RightName;
54 T WrongName;
59 template<typename T>
60 struct wrapper6 {
61 union {
62 union{
63 int : 5;
64 T RightName;
71 template<auto tparam> void dummy(){}
74 void uses() {
75 // Zero init'ed cases.
76 dummy<wrapper1<int>{}>();
77 // CHECK: call void @_Z5dummyITnDaXtl8wrapper1IiEEEEvv
78 // DEMANGLED: call void @void dummy<wrapper1<int>{}>()()
79 dummy<wrapper2<float>{}>();
80 // CHECK: call void @_Z5dummyITnDaXtl8wrapper2IfEEEEvv
81 // DEMANGLED: call void @void dummy<wrapper2<float>{}>()()
82 dummy<wrapper3<short>{}>();
83 // CHECK: call void @_Z5dummyITnDaXtl8wrapper3IsEEEEvv
84 // DEMANGLED: call void @void dummy<wrapper3<short>{}>()()
85 dummy<wrapper4<double>{}>();
86 // CHECK: call void @_Z5dummyITnDaXtl8wrapper4IdEEEEvv
87 // DEMANGLED: call void @void dummy<wrapper4<double>{}>()()
88 dummy<wrapper5<long long>{}>();
89 // CHECK: call void @_Z5dummyITnDaXtl8wrapper5IxEEEEvv
90 // DEMANGLED: call void @void dummy<wrapper5<long long>{}>()()
91 dummy<wrapper6<int>{}>();
92 // CHECK: call void @_Z5dummyITnDaXtl8wrapper6IiEEEEvv
93 // DEMANGLED: call void @void dummy<wrapper6<int>{}>()()
95 dummy<wrapper1<double>{123.0}>();
96 // CHECK: call void @_Z5dummyITnDaXtl8wrapper1IdEtlNS1_Ut_Edi9RightNametlNS2_Ut_ELd405ec00000000000EEEEEEvv
97 // DEMANGLED: call void @void dummy<wrapper1<double>{wrapper1<double>::'unnamed'{.RightName = wrapper1<double>::'unnamed'::'unnamed'{0x1.ec{{.*}}p+6}}}>()()
98 dummy<wrapper2<double>{123.0}>();
99 // CHECK: call void @_Z5dummyITnDaXtl8wrapper2IdEtlNS1_Ut_Edi9RightNametlNS2_Ut_ELd405ec00000000000EEEEEEvv
100 // DEMANGLED: call void @void dummy<wrapper2<double>{wrapper2<double>::'unnamed'{.RightName = wrapper2<double>::'unnamed'::'unnamed'{0x1.ec{{.*}}p+6}}}>()()
101 dummy<wrapper3<double>{123, 456}>();
102 // CHECK: call void @_Z5dummyITnDaXtl8wrapper3IdEtlNS1_Ut_Edi9RightNametlNS2_Ut_Etl4BaseLi123EELd407c800000000000EEEEEEvv
103 // DEMANGLED: call void @void dummy<wrapper3<double>{wrapper3<double>::'unnamed'{.RightName = wrapper3<double>::'unnamed'::'unnamed'{Base{123}, 0x1.c8{{.*}}p+8}}}>()()
104 dummy<wrapper4<double>{123}>();
105 // CHECK: call void @_Z5dummyITnDaXtl8wrapper4IdEtlNS1_Ut_Edi9RightNameLi123EEEEEvv
106 // DEMANGLED: call void @void dummy<wrapper4<double>{wrapper4<double>::'unnamed'{.RightName = 123}}>()()
107 dummy<wrapper5<double>{123.0, 456.0}>();
108 // CHECK: call void @_Z5dummyITnDaXtl8wrapper5IdEtlNS1_Ut_Edi9RightNametlNS2_Ut_EtlNS3_Ut_ELd405ec00000000000EELd407c800000000000EEEEEEvv
109 // DEMANGLED: call void @void dummy<wrapper5<double>{wrapper5<double>::'unnamed'{.RightName = wrapper5<double>::'unnamed'::'unnamed'{wrapper5<double>::'unnamed'::'unnamed'::'unnamed'{0x1.ec{{.*}}p+6}, 0x1.c8{{.*}}p+8}}}>()()
110 dummy<wrapper6<double>{1}>();
111 // CHECK: call void @_Z5dummyITnDaXtl8wrapper6IdEtlNS1_Ut_Edi9RightNametlNS2_Ut_Edi9RightNameLd3ff0000000000000EEEEEEvv
112 // DEMANGELD: call void @void dummy<wrapper6<double>{wrapper6<double>::'unnamed'{.RightName = wrapper6<double>::'unnamed'::'unnamed'{.RightName = 0x1{{.*}}p+0}}}>()()