blob: ff141faf644eb7fb64cde2b575ca932efc4292fa [file] [edit]
// Tests that the module dependency scan properly outputs diagnostics which
// were collected during the dependency scan.
// RUN: split-file %s %t
// RUN: not %clang -### -fmodules -fmodules-driver -Rmodules-driver \
// RUN: -fmodule-map-file=%t/module.modulemap %t/main.cpp 2>&1 \
// RUN: -fmodules-cache-path=%t/modules-cache \
// RUN: | FileCheck --check-prefixes=CHECK %s
//--- module.modulemap
module a { header "a.h" }
//--- a.h
// Diagnostics collected during the dependency scan need to be translated to
// and from a representation that can outlive the compiler invocation they
// were generated by.
// We test that the diagnostics source location is translated correctly:
//----10|-------20|--------30|
#include /*just some space*/ "doesnotexist.h"
// CHECK: a.h:6:30: fatal error: 'doesnotexist.h' file not found
//--- main.cpp
#include "a.h"
// CHECK: clang: error: failed to perform dependency scan