cxx-mangling.cpp 752 B

12345678910111213141516171819202122232425262728
  1. // Test without PCH.
  2. // RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -include %s %s -emit-llvm -o - | FileCheck %s
  3. //
  4. // Test with PCH.
  5. // RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -x c++-header %s -emit-pch -o %t
  6. // RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -include-pch %t %s -emit-llvm -o - | FileCheck %s
  7. #ifndef HEADER
  8. #define HEADER
  9. struct A {
  10. struct { int a; } a;
  11. struct { int b; } b;
  12. };
  13. #else
  14. template<typename T> void f(T) {}
  15. // CHECK-LABEL: define {{.*}}void @_Z1g1A(
  16. void g(A a) {
  17. // CHECK: call {{.*}}void @_Z1fIN1AUt0_EEvT_(
  18. f(a.b);
  19. // CHECK: call {{.*}}void @_Z1fIN1AUt_EEvT_(
  20. f(a.a);
  21. }
  22. #endif