brintos

brintos / llvm-project-archived public Read only

0
0
Text · 982 B · 790a3af Raw
52 lines · plain
1// Test that we will skip ODR checks for declarations from PCH if they2// were from GMF.3//4// RUN: rm -rf %t5// RUN: mkdir -p %t6// RUN: split-file %s %t7//8// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/A.cppm \9// RUN:   -o %t/A.pcm -fskip-odr-check-in-gmf10// RUN: %clang_cc1 -std=c++20 -DDIFF -x c++-header %t/foo.h \11// RUN:   -emit-pch -o %t/foo.pch -fskip-odr-check-in-gmf12// RUN: %clang_cc1 -std=c++20 %t/B.cppm -fmodule-file=A=%t/A.pcm -include-pch \13// RUN:   %t/foo.pch -verify -fsyntax-only -fskip-odr-check-in-gmf14 15//--- foo.h16#ifndef FOO_H17#define FOO_H18inline int foo() {19#ifndef DIFF20  return 43;21#else22  return 45;23#endif24}25 26class f {27public:28  int mem() {29#ifndef DIFF30    return 47;31#else32    return 45;33#endif34  }35};36#endif37 38//--- A.cppm39module;40#include "foo.h"41export module A;42export using ::foo;43export using ::f;44 45//--- B.cppm46// expected-no-diagnostics47module;48#include "foo.h"49export module B;50import A;51export int b = foo() + f().mem();52