[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / clang / test / CodeGenCXX / member-function-pointer-calls.cpp
blobff511c024380187018cc94f92ef467c53fe35f5e
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
6 struct A {
7 virtual int vf1() { return 1; }
8 virtual int vf2() { return 2; }
9 };
11 int f(A* a, int (A::*fp)()) {
12 return (a->*fp)();
15 // CHECK-LABEL: define{{.*}} i32 @_Z2g1v()
16 // CHECK-NOT: }
17 // CHECK: ret i32 1
18 // MINGW64-LABEL: define dso_local noundef i32 @_Z2g1v()
19 // MINGW64: call noundef i32 @_Z1fP1AMS_FivE(ptr noundef %{{.*}}, ptr noundef %{{.*}})
20 int g1() {
21 A a;
22 return f(&a, &A::vf1);
25 // CHECK-LABEL: define{{.*}} i32 @_Z2g2v()
26 // CHECK-NOT: }
27 // CHECK: ret i32 2
28 // MINGW64-LABEL: define dso_local noundef i32 @_Z2g2v()
29 // MINGW64: call noundef i32 @_Z1fP1AMS_FivE(ptr noundef %{{.*}}, ptr noundef %{{.*}})
30 int g2() {
31 A a;
32 return f(&a, &A::vf2);