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/e.cppm -o %t/e.pcm
13 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/f.cppm -o %t/f.pcm
14 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/g.cpp \
15 // RUN: -fprebuilt-module-path=%t
17 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/h.cppm \
18 // RUN: -fprebuilt-module-path=%t -o %t/h.pcm
19 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/i.cppm \
20 // RUN: -fprebuilt-module-path=%t -o %t/i.pcm
21 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/j.cpp \
22 // RUN: -fprebuilt-module-path=%t
23 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/k.cpp \
24 // RUN: -fprebuilt-module-path=%t
40 // expected-no-diagnostics
41 // Since we will load all the declaration lazily, we won't be able to find
42 // the ODR violation here.
49 // Test that we can still check the odr violation if we call the function
52 foo(); // expected-error@* {{'foo' has different definitions in different modules;}}
53 // expected-note@* {{but in 'a' found a different body}}
83 foo(); // expected-error@* {{'foo' has different definitions in different modules;}}
84 // expected-note@* {{but in 'e.<global>' found a different body}}
100 foo(); // expected-error@* {{'foo' has different definitions in different modules;}}
101 // expected-note@* {{but in 'a' found a different body}}
107 foo(); // expected-error@* {{'foo' has different definitions in different modules;}}
108 // expected-note@* {{but in 'e.<global>' found a different body}}