xref: /minix3/external/bsd/llvm/dist/clang/test/PCH/cxx-mangling.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // Test without PCH.
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -include %s %s -emit-llvm -o - | FileCheck %s
3*0a6a1f1dSLionel Sambuc //
4*0a6a1f1dSLionel Sambuc // Test with PCH.
5*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -x c++-header %s -emit-pch -o %t
6*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -include-pch %t %s -emit-llvm -o - | FileCheck %s
7*0a6a1f1dSLionel Sambuc 
8*0a6a1f1dSLionel Sambuc #ifndef HEADER
9*0a6a1f1dSLionel Sambuc #define HEADER
10*0a6a1f1dSLionel Sambuc 
11*0a6a1f1dSLionel Sambuc struct A {
12*0a6a1f1dSLionel Sambuc   struct { int a; } a;
13*0a6a1f1dSLionel Sambuc   struct { int b; } b;
14*0a6a1f1dSLionel Sambuc };
15*0a6a1f1dSLionel Sambuc 
16*0a6a1f1dSLionel Sambuc #else
17*0a6a1f1dSLionel Sambuc 
f(T)18*0a6a1f1dSLionel Sambuc template<typename T> void f(T) {}
19*0a6a1f1dSLionel Sambuc 
20*0a6a1f1dSLionel Sambuc // CHECK-LABEL: define void @_Z1g1A(
g(A a)21*0a6a1f1dSLionel Sambuc void g(A a) {
22*0a6a1f1dSLionel Sambuc   // CHECK: call void @_Z1fIN1AUt0_EEvT_(
23*0a6a1f1dSLionel Sambuc   f(a.b);
24*0a6a1f1dSLionel Sambuc   // CHECK: call void @_Z1fIN1AUt_EEvT_(
25*0a6a1f1dSLionel Sambuc   f(a.a);
26*0a6a1f1dSLionel Sambuc }
27*0a6a1f1dSLionel Sambuc 
28*0a6a1f1dSLionel Sambuc #endif
29