xref: /minix3/external/bsd/llvm/dist/clang/test/Index/print-mangled-name.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple i686-pc-linux-gnu -emit-pch %s -o %t_linux.ast
2*0a6a1f1dSLionel Sambuc // RUN: c-index-test -test-print-mangle %t_linux.ast | FileCheck %s --check-prefix=ITANIUM
3*0a6a1f1dSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-pch %s -o %t_macho.ast
5*0a6a1f1dSLionel Sambuc // RUN: c-index-test -test-print-mangle %t_macho.ast | FileCheck %s --check-prefix=MACHO
6*0a6a1f1dSLionel Sambuc 
7*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple i686-pc-win32 -emit-pch %s -o %t_msft.ast
8*0a6a1f1dSLionel Sambuc // RUN: c-index-test -test-print-mangle %t_msft.ast | FileCheck %s --check-prefix=MICROSOFT
9*0a6a1f1dSLionel Sambuc 
10*0a6a1f1dSLionel Sambuc int foo(int, int);
11*0a6a1f1dSLionel Sambuc // ITANIUM: mangled=_Z3fooii
12*0a6a1f1dSLionel Sambuc // MACHO: mangled=__Z3fooii
13*0a6a1f1dSLionel Sambuc // MICROSOFT: mangled=?foo@@YAHHH
14*0a6a1f1dSLionel Sambuc 
15*0a6a1f1dSLionel Sambuc int foo(float, int);
16*0a6a1f1dSLionel Sambuc // ITANIUM: mangled=_Z3foofi
17*0a6a1f1dSLionel Sambuc // MACHO: mangled=__Z3foofi
18*0a6a1f1dSLionel Sambuc // MICROSOFT: mangled=?foo@@YAHMH
19*0a6a1f1dSLionel Sambuc 
20*0a6a1f1dSLionel Sambuc struct S {
21*0a6a1f1dSLionel Sambuc   int x, y;
22*0a6a1f1dSLionel Sambuc };
23*0a6a1f1dSLionel Sambuc // ITANIUM: StructDecl{{.*}}mangled=]
24*0a6a1f1dSLionel Sambuc // MACHO: StructDecl{{.*}}mangled=]
25*0a6a1f1dSLionel Sambuc // MICROSOFT: StructDecl{{.*}}mangled=]
26*0a6a1f1dSLionel Sambuc 
27*0a6a1f1dSLionel Sambuc int foo(S, S&);
28*0a6a1f1dSLionel Sambuc // ITANIUM: mangled=_Z3foo1SRS_
29*0a6a1f1dSLionel Sambuc // MACHO: mangled=__Z3foo1SRS_
30*0a6a1f1dSLionel Sambuc // MICROSOFT: mangled=?foo@@YAHUS
31