1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -O3 -o - | FileCheck %s
2 /// Check that we pass the member pointers indirectly for MinGW64
3 // RUN: %clang_cc1 %s -triple=x86_64-windows-gnu -emit-llvm -o - | FileCheck %s -check-prefix MINGW64
4 /// We should be able to optimize calls via the indirectly passed member pointers
5 // RUN: %clang_cc1 %s -triple=x86_64-windows-gnu -emit-llvm -O3 -o - | FileCheck %s
7 virtual int vf1() { return 1; }
8 virtual int vf2() { return 2; }
11 int f(A
* a
, int (A::*fp
)()) {
15 // CHECK-LABEL: define{{.*}} i32 @_Z2g1v()
18 // MINGW64-LABEL: define dso_local noundef i32 @_Z2g1v()
19 // MINGW64: call noundef i32 @_Z1fP1AMS_FivE(ptr noundef %{{.*}}, ptr noundef %{{.*}})
22 return f(&a
, &A::vf1
);
25 // CHECK-LABEL: define{{.*}} i32 @_Z2g2v()
28 // MINGW64-LABEL: define dso_local noundef i32 @_Z2g2v()
29 // MINGW64: call noundef i32 @_Z1fP1AMS_FivE(ptr noundef %{{.*}}, ptr noundef %{{.*}})
32 return f(&a
, &A::vf2
);