[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGenCXX / ms-union-member-ref.cpp
blobb6afeff926bf55a0206314e1be589acd754e1834
1 // RUN: %clang_cc1 -triple=i686-pc-win32 -fms-extensions %s -emit-llvm -o- | FileCheck %s
3 union A {
4 int *&ref;
5 int **ptr;
6 };
8 int *f1(A *a) {
9 return a->ref;
11 // CHECK-LABEL: define {{.*}}ptr @"?f1@@YAPAHPATA@@@Z"(ptr noundef %a)
12 // CHECK: [[A_ADDR:%[^[:space:]]+]] = load ptr, ptr %{{.*}}
13 // CHECK: [[IPP:%[^[:space:]]+]] = load ptr, ptr [[A_ADDR]]
14 // CHECK: [[IP:%[^[:space:]]+]] = load ptr, ptr [[IPP]]
15 // CHECK: ret ptr [[IP]]
17 void f2(A *a) {
18 *a->ref = 1;
20 // CHECK-LABEL: define {{.*}}void @"?f2@@YAXPATA@@@Z"(ptr noundef %a)
21 // CHECK: [[A_ADDR:%[^[:space:]]+]] = load ptr, ptr %{{.*}}
22 // CHECK: [[IPP:%[^[:space:]]+]] = load ptr, ptr [[A_ADDR]]
23 // CHECK: [[IP:%[^[:space:]]+]] = load ptr, ptr [[IPP]]
24 // CHECK: store i32 1, ptr [[IP]]
26 bool f3(A *a, int *b) {
27 return a->ref != b;
29 // CHECK-LABEL: define {{.*}}i1 @"?f3@@YA_NPATA@@PAH@Z"(ptr noundef %a, ptr noundef %b)
30 // CHECK: [[A_ADDR:%[^[:space:]]+]] = load ptr, ptr %{{.*}}
31 // CHECK: [[IPP:%[^[:space:]]+]] = load ptr, ptr [[A_ADDR]]
32 // CHECK: [[IP:%[^[:space:]]+]] = load ptr, ptr [[IPP]]
33 // CHECK: [[IP2:%[^[:space:]]+]] = load ptr, ptr %b.addr
34 // CHECK: icmp ne ptr [[IP]], [[IP2]]