[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGenCXX / microsoft-inaccessible-base.cpp
blob2d218e2aab10d6e5f0f4b862ebd17fc9d21f79fa
1 // RUN: %clang_cc1 -fms-compatibility -triple x86_64-windows-msvc %s -emit-llvm -o - | FileCheck %s
3 // Make sure we choose the *direct* base path when doing these conversions.
5 struct A { int a; };
6 struct B : A { int b; };
8 struct C : A, B { };
9 extern "C" A *a_from_c(C *p) { return p; }
10 // CHECK-LABEL: define dso_local ptr @a_from_c(ptr noundef %{{.*}})
11 // CHECK: [[P_ADDR:%.*]] = alloca ptr
12 // CHECK-NEXT: store ptr [[P:%.*]], ptr [[P_ADDR]]
13 // CHECK-NEXT: [[RET:%.*]] = load ptr, ptr [[P_ADDR]]
14 // CHECK-NEXT: ret ptr [[RET]]
16 struct D : B, A { };
17 extern "C" A *a_from_d(D *p) { return p; }
18 // CHECK-LABEL: define dso_local ptr @a_from_d(ptr noundef %{{.*}})
19 // CHECK: [[P_ADDR:%.*]] = alloca ptr
20 // CHECK-NEXT: store ptr [[P:%.*]], ptr [[P_ADDR]]
21 // CHECK-NEXT: [[P_RELOAD:%.*]] = load ptr, ptr [[P_ADDR]]
22 // CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[P_RELOAD]], null
23 // CHECK: [[ADD_PTR:%.*]] = getelementptr inbounds i8, ptr [[P_RELOAD]], i64 8
24 // CHECK: [[RET:%.*]] = phi ptr [ [[ADD_PTR]], {{.*}} ], [ null, %entry ]
25 // CHECK-NEXT: ret ptr [[RET]]