xref: /llvm-project/clang/test/CodeGenCXX/mangle-win64-ccs.cpp (revision 1b9a6e58a8b831193c9e5e733f881aabe0d2d06b)
1 // RUN: %clang_cc1 -triple x86_64-windows-gnu -o - -emit-llvm %s | FileCheck %s -check-prefix CHECK-WIN
2 // RUN: %clang_cc1 -triple x86_64-linux-gnu -o - -emit-llvm %s | FileCheck %s -check-prefix CHECK-LIN
3 
4 typedef __PTRDIFF_TYPE__ ptrdiff_t;
func_as_int(FTy * fp)5 template <typename FTy> ptrdiff_t func_as_int(FTy *fp) { return ptrdiff_t(fp); }
6 
7 int f_plain(int);
8 int __attribute__((sysv_abi)) f_sysvabi(int);
9 int __attribute__((ms_abi)) f_msabi(int);
useThem()10 ptrdiff_t useThem() {
11   ptrdiff_t rv = 0;
12   rv += func_as_int(f_plain);
13   rv += func_as_int(f_sysvabi);
14   rv += func_as_int(f_msabi);
15   return rv;
16 }
17 
18 // CHECK-WIN: define dso_local noundef i64 @_Z7useThemv()
19 // CHECK-WIN:   call noundef i64 @_Z11func_as_intIFiiEExPT_(ptr noundef @_Z7f_plaini)
20 // CHECK-WIN:   call noundef i64 @_Z11func_as_intIU8sysv_abiFiiEExPT_(ptr noundef @_Z9f_sysvabii)
21 // CHECK-WIN:   call noundef i64 @_Z11func_as_intIFiiEExPT_(ptr noundef @_Z7f_msabii)
22 
23 // CHECK-LIN: define{{.*}} i64 @_Z7useThemv()
24 // CHECK-LIN:   call noundef i64 @_Z11func_as_intIFiiEElPT_(ptr noundef @_Z7f_plaini)
25 // CHECK-LIN:   call noundef i64 @_Z11func_as_intIFiiEElPT_(ptr noundef @_Z9f_sysvabii)
26 // CHECK-LIN:   call noundef i64 @_Z11func_as_intIU6ms_abiFiiEElPT_(ptr noundef @_Z7f_msabii)
27