print-mangled-name.cpp 1007 B

12345678910111213141516171819202122232425262728293031
  1. // REQUIRES: x86-registered-target
  2. // RUN: %clang_cc1 -triple i686-pc-linux-gnu -emit-pch %s -o %t_linux.ast
  3. // RUN: c-index-test -test-print-mangle %t_linux.ast | FileCheck %s --check-prefix=ITANIUM
  4. // 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. // RUN: %clang_cc1 -triple i686-pc-win32 -emit-pch %s -o %t_msft.ast
  7. // RUN: c-index-test -test-print-mangle %t_msft.ast | FileCheck %s --check-prefix=MICROSOFT
  8. int foo(int, int);
  9. // ITANIUM: mangled=_Z3fooii
  10. // MACHO: mangled=__Z3fooii
  11. // MICROSOFT: mangled=?foo@@YAHHH
  12. int foo(float, int);
  13. // ITANIUM: mangled=_Z3foofi
  14. // MACHO: mangled=__Z3foofi
  15. // MICROSOFT: mangled=?foo@@YAHMH
  16. struct S {
  17. int x, y;
  18. };
  19. // ITANIUM: StructDecl{{.*}}mangled=]
  20. // MACHO: StructDecl{{.*}}mangled=]
  21. // MICROSOFT: StructDecl{{.*}}mangled=]
  22. int foo(S, S&);
  23. // ITANIUM: mangled=_Z3foo1SRS_
  24. // MACHO: mangled=__Z3foo1SRS_
  25. // MICROSOFT: mangled=?foo@@YAHUS