blob: b7e79c3f6d659a8c45eb5b024f3c55de3af9e483 [file] [log] [blame]
Eli Bendersky44a206f2014-07-31 18:04:56 +00001// RUN: %clang_cc1 -triple i686-pc-linux-gnu -emit-pch %s -o %t_linux.ast
2// RUN: c-index-test -test-print-mangle %t_linux.ast | FileCheck %s --check-prefix=ITANIUM
3
Eli Bendersky79759592014-08-01 15:01:10 +00004// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-pch %s -o %t_macho.ast
5// RUN: c-index-test -test-print-mangle %t_macho.ast | FileCheck %s --check-prefix=MACHO
6
Eli Bendersky44a206f2014-07-31 18:04:56 +00007// RUN: %clang_cc1 -triple i686-pc-win32 -emit-pch %s -o %t_msft.ast
8// RUN: c-index-test -test-print-mangle %t_msft.ast | FileCheck %s --check-prefix=MICROSOFT
9
10int foo(int, int);
11// ITANIUM: mangled=_Z3fooii
Eli Bendersky79759592014-08-01 15:01:10 +000012// MACHO: mangled=__Z3fooii
Eli Bendersky44a206f2014-07-31 18:04:56 +000013// MICROSOFT: mangled=?foo@@YAHHH
14
15int foo(float, int);
16// ITANIUM: mangled=_Z3foofi
Eli Bendersky79759592014-08-01 15:01:10 +000017// MACHO: mangled=__Z3foofi
Eli Bendersky44a206f2014-07-31 18:04:56 +000018// MICROSOFT: mangled=?foo@@YAHMH
19
20struct S {
21 int x, y;
22};
23// ITANIUM: StructDecl{{.*}}mangled=]
Eli Bendersky79759592014-08-01 15:01:10 +000024// MACHO: StructDecl{{.*}}mangled=]
Eli Bendersky44a206f2014-07-31 18:04:56 +000025// MICROSOFT: StructDecl{{.*}}mangled=]
26
27int foo(S, S&);
Eli Bendersky79759592014-08-01 15:01:10 +000028// ITANIUM: mangled=_Z3foo1SRS_
29// MACHO: mangled=__Z3foo1SRS_
Eli Bendersky44a206f2014-07-31 18:04:56 +000030// MICROSOFT: mangled=?foo@@YAHUS