44 lines · c
1// This test checks that we don't crash when we load two conflicting PCM files2// and instead emit the appropriate diagnostics.3 4// RUN: rm -rf %t5// RUN: split-file %s %t6 7// RUN: mkdir %t/frameworks18 9// RUN: clang-scan-deps -format experimental-full -o %t/deps1.json -- \10// RUN: %clang -fmodules -fmodules-cache-path=%t/cache \11// RUN: -F %t/frameworks1 -F %t/frameworks2 \12// RUN: -c %t/tu1.m -o %t/tu1.o13 14// RUN: cp -r %t/frameworks2/A.framework %t/frameworks115 16// RUN: not clang-scan-deps -format experimental-full -o %t/deps2.json 2>%t/errs -- \17// RUN: %clang -fmodules -fmodules-cache-path=%t/cache \18// RUN: -F %t/frameworks1 -F %t/frameworks2 \19// RUN: -c %t/tu2.m -o %t/tu2.o20// RUN: FileCheck --input-file=%t/errs %s21 22// CHECK: fatal error: module 'A' is defined in both '{{.*}}.pcm' and '{{.*}}.pcm'23// CHECK-NEXT: note: compiled from '{{.*}}frameworks1{{.*}}' and '{{.*}}frameworks2{{.*}}'24 25//--- frameworks2/A.framework/Modules/module.modulemap26framework module A { header "A.h" }27//--- frameworks2/A.framework/Headers/A.h28#define MACRO_A 129 30//--- frameworks2/B.framework/Modules/module.modulemap31framework module B { header "B.h" }32//--- frameworks2/B.framework/Headers/B.h33#include <A/A.h>34 35//--- tu1.m36#include <B/B.h>37 38//--- tu2.m39#include <A/A.h>40#include <B/B.h> // This results in a conflict and a fatal loader error.41 42#if MACRO_A // This crashes with lexer that does not respect `cutOfLexing()`.43#endif44