27 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-windows-gnu -o - -emit-llvm %s | FileCheck %s -check-prefix CHECK-WIN2// RUN: %clang_cc1 -triple x86_64-linux-gnu -o - -emit-llvm %s | FileCheck %s -check-prefix CHECK-LIN3 4typedef __PTRDIFF_TYPE__ ptrdiff_t;5template <typename FTy> ptrdiff_t func_as_int(FTy *fp) { return ptrdiff_t(fp); }6 7int f_plain(int);8int __attribute__((sysv_abi)) f_sysvabi(int);9int __attribute__((ms_abi)) f_msabi(int);10ptrdiff_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