brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 49ee277 Raw
47 lines · plain
1## Tests the case where module compilation fails.2#3# REQUIRES: system-darwin4#5# RUN: split-file %s %t/sources6# RUN: %clang_host -g %t/sources/main.m -fmodules -fcxx-modules \7# RUN:             -DSHOULD_COMPILE=1 \8# RUN:             -fmodule-map-file=%t/sources/module.modulemap \9# RUN:             -fmodules-cache-path=%t/ModuleCache -o %t.out10#11# RUN: %lldb -x -o "settings set interpreter.stop-command-source-on-error false" \12# RUN:       -s %t/sources/commands.input %t.out -o exit 2>&1 | FileCheck %s13 14#--- main.m15@import foo;16 17int main() { __builtin_debugtrap(); }18 19#--- foo.h20struct foo {};21 22#ifndef SHOULD_COMPILE23#error "Compilation failure."24#endif25 26#--- module.modulemap27module foo {28    header "foo.h"29    export *30}31 32#--- commands.input33log enable lldb expr34run35## Make sure expression fails so the 'note' diagnostics get printed.36expr blah37 38# CHECK: Finished building Clang module foo39# CHECK: couldn't load top-level module foo:40# CHECK: While building module 'foo' imported from LLDBModulesMemoryBuffer41# CHEKC: {{.*}}sources/foo.h{{.*}}: error: "Compilation failure."42# CHECK: LLDBModulesMemoryBuffer:1:1: fatal error: could not build module 'foo'43 44# CHECK: Error while loading hand-imported modules:45# CHECK: couldn't load top-level module foo:46# CHECK-NOT: Compilation failure47