xref: /llvm-project/clang/test/Modules/merge-record-definition.m (revision 7793e676514bc102e97a993e90257e8628069a8b)
1// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
2// RUN: rm -rf %t
3// RUN: mkdir %t
4// RUN: %clang_cc1 -emit-llvm -o %t/test.bc -F%S/Inputs/merge-record-definition %s \
5// RUN:            -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
6
7// Test a case when a struct definition is present in two different modules.
8
9#import <RecordDef/RecordDef.h>
10
11void bibi(void) {
12  Buffer buf;
13  buf.b = 1;
14  AnonymousStruct strct;
15  strct.x = 1;
16  UnionRecord rec;
17  rec.u = 1;
18}
19
20#import <RecordDefCopy/RecordDefCopy.h>
21
22void mbap(void) {
23  Buffer buf;
24  buf.c = 2;
25  AnonymousStruct strct;
26  strct.y = 2;
27  UnionRecord rec;
28  rec.v = 2;
29}
30