2 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/a.cppm -o %t/a.pcm
6 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/b.cppm -o %t/b.pcm
7 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/c.cpp \
8 // RUN: -fprebuilt-module-path=%t
9 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/d.cpp \
10 // RUN: -fprebuilt-module-path=%t
12 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/h.cppm \
13 // RUN: -fprebuilt-module-path=%t -o %t/h.pcm
14 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/j.cpp \
15 // RUN: -fprebuilt-module-path=%t
31 // expected-no-diagnostics
32 // Since we will load all the declaration lazily, we won't be able to find
33 // the ODR violation here.
40 // Test that we can still check the odr violation if we call the function
43 foo(); // expected-error@* {{'foo' has different definitions in different modules;}}
44 // expected-note@* {{but in 'a' found a different body}}
47 // expected-error@a.cppm:* {{declaration 'foo' attached to named module 'a' cannot be attached to other modules}}
48 // expected-note@b.cppm:* {{}}
58 foo(); // expected-error@* {{'foo' has different definitions in different modules;}}
59 // expected-note@* {{but in 'a' found a different body}}
62 // expected-error@a.cppm:* {{declaration 'foo' attached to named module 'a' cannot be attached to other modules}}
63 // expected-note@b.cppm:* {{}}