2018-01-12 12:42:27 +08:00
|
|
|
// RUN: rm -rf %t
|
|
|
|
|
2018-02-22 13:50:29 +08:00
|
|
|
// PR35939: MicrosoftMangle.cpp triggers an assertion failure on this test.
|
|
|
|
// UNSUPPORTED: system-windows
|
|
|
|
|
|
|
|
// RUN: %clang_cc1 \
|
2018-01-12 12:42:27 +08:00
|
|
|
// RUN: -I %S/Inputs/odr_hash-Friend \
|
|
|
|
// RUN: -emit-obj -o /dev/null \
|
|
|
|
// RUN: -fmodules \
|
|
|
|
// RUN: -fimplicit-module-maps \
|
|
|
|
// RUN: -fmodules-cache-path=%t/modules.cache \
|
2018-09-06 06:14:46 +08:00
|
|
|
// RUN: -std=c++11 -x c++ %s -verify -DTEST1
|
2018-01-12 12:42:27 +08:00
|
|
|
|
2018-02-22 13:50:29 +08:00
|
|
|
// RUN: %clang_cc1 \
|
|
|
|
// RUN: -I %S/Inputs/odr_hash-Friend \
|
|
|
|
// RUN: -emit-obj -o /dev/null \
|
|
|
|
// RUN: -fmodules \
|
|
|
|
// RUN: -fimplicit-module-maps \
|
|
|
|
// RUN: -fmodules-cache-path=%t/modules.cache \
|
2018-09-06 06:14:46 +08:00
|
|
|
// RUN: -std=c++11 -x c++ %s -verify -DTEST2
|
2018-02-22 13:50:29 +08:00
|
|
|
|
|
|
|
// RUN: %clang_cc1 \
|
|
|
|
// RUN: -I %S/Inputs/odr_hash-Friend \
|
|
|
|
// RUN: -emit-obj -o /dev/null \
|
|
|
|
// RUN: -fmodules \
|
|
|
|
// RUN: -fimplicit-module-maps \
|
|
|
|
// RUN: -fmodules-cache-path=%t/modules.cache \
|
2018-09-06 06:14:46 +08:00
|
|
|
// RUN: -std=c++11 -x c++ %s -verify -DTEST3
|
2018-02-22 13:50:29 +08:00
|
|
|
|
|
|
|
// RUN: %clang_cc1 \
|
|
|
|
// RUN: -I %S/Inputs/odr_hash-Friend \
|
|
|
|
// RUN: -emit-obj -o /dev/null \
|
|
|
|
// RUN: -fmodules \
|
|
|
|
// RUN: -fimplicit-module-maps \
|
|
|
|
// RUN: -fmodules-cache-path=%t/modules.cache \
|
2018-09-06 06:14:46 +08:00
|
|
|
// RUN: -std=c++11 -x c++ %s -verify -DTEST3
|
2018-02-22 13:50:29 +08:00
|
|
|
|
|
|
|
// RUN: %clang_cc1 \
|
|
|
|
// RUN: -I %S/Inputs/odr_hash-Friend \
|
|
|
|
// RUN: -emit-obj -o /dev/null \
|
|
|
|
// RUN: -fmodules \
|
|
|
|
// RUN: -fimplicit-module-maps \
|
|
|
|
// RUN: -fmodules-cache-path=%t/modules.cache \
|
2018-09-06 06:14:46 +08:00
|
|
|
// RUN: -std=c++11 -x c++ %s -verify -DTEST3
|
2018-01-13 05:49:20 +08:00
|
|
|
|
2018-02-22 13:50:29 +08:00
|
|
|
#if defined(TEST1)
|
|
|
|
#include "Box.h"
|
|
|
|
#include "M1.h"
|
|
|
|
#include "M3.h"
|
2018-01-12 12:42:27 +08:00
|
|
|
// expected-no-diagnostics
|
2018-02-22 13:50:29 +08:00
|
|
|
#endif
|
2018-01-12 12:42:27 +08:00
|
|
|
|
2018-02-22 13:50:29 +08:00
|
|
|
#if defined(TEST2)
|
2018-01-12 12:42:27 +08:00
|
|
|
#include "Box.h"
|
|
|
|
#include "M1.h"
|
|
|
|
#include "M3.h"
|
2018-02-22 13:50:29 +08:00
|
|
|
#include "Good.h"
|
|
|
|
// expected-no-diagnostics
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(TEST3)
|
|
|
|
#include "Good.h"
|
|
|
|
#include "Box.h"
|
|
|
|
#include "M1.h"
|
|
|
|
#include "M3.h"
|
|
|
|
// expected-no-diagnostics
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(TEST4)
|
|
|
|
#include "Box.h"
|
|
|
|
#include "M1.h"
|
|
|
|
#include "M3.h"
|
|
|
|
#include "Bad.h"
|
|
|
|
// expected-error@Bad.h:* {{'Check' has different definitions in different modules; definition in module 'Bad' first difference is function body}}
|
|
|
|
// expected-note@Box.h:* {{but in 'Box' found a different body}}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(TEST5)
|
|
|
|
#include "Bad.h"
|
|
|
|
#include "Box.h"
|
|
|
|
#include "M1.h"
|
|
|
|
#include "M3.h"
|
|
|
|
// expected-error@Bad.h:* {{'Check' has different definitions in different modules; definition in module 'Bad' first difference is function body}}
|
|
|
|
// expected-note@Box.h:* {{but in 'Box' found a different body}}
|
|
|
|
#endif
|
|
|
|
|
2018-01-12 12:42:27 +08:00
|
|
|
|
|
|
|
void Run() {
|
|
|
|
Box<> Present;
|
|
|
|
}
|