Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

module 'conflict' stanza doesn't work across top-level modules #19357

Open Quuxplusone opened 10 years ago

Quuxplusone commented 10 years ago
Bugzilla Link PR19358
Status NEW
Importance P normal
Reported by Richard Smith (richard-llvm@metafoo.co.uk)
Reported on 2014-04-07 12:22:24 -0700
Last modified on 2014-10-03 21:18:13 -0700
Version unspecified
Hardware PC All
CC dgregor@apple.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
Repro:

module A {}
module B { conflict A }

Building B will assert, because it tries to allocate a submodule ID for 'A',
which is neither part of the currently-building module nor in a module that it
imports.
Quuxplusone commented 10 years ago
We get a similar failure if a module exports another top-level module that it
doesn't otherwise depend on. Here's a lit test:

// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -emit-module -fmodule-name=B -x c++ %s -fmodules-
cache-path=%t
// RUN: %clang_cc1 -fmodules -emit-module -fmodule-name=A -x c++ %s -fmodules-
cache-path=%t
// RUN: %clang_cc1 -fmodules -emit-module -fmodule-name=C -x c++ %s -fmodules-
cache-path=%t
module A {}
module B { conflict A, "can't have A and B together" }
module C {
  export A
  export B
}