brintos

brintos / llvm-project-archived public Read only

0
0
Text · 678 B · 389aaa4 Raw
28 lines · c
1// RUN: %clang_cc1 %s -emit-pch -o %t1.pch -verify2// RUN: %clang_cc1 %s -emit-pch -o %t2.pch -include-pch %t1.pch -verify3// RUN: %clang_cc1 -fsyntax-only %s -include-pch %t2.pch -verify4 5// Test that a redefinition inside the PCH won't manifest as an ambiguous macro.6 7#ifndef HEADER18#define HEADER19 10#define M1 0 // expected-note {{previous}}11#define M1 1 // expected-warning {{redefined}}12 13#define M2 314 15#elif !defined(HEADER2)16#define HEADER217 18#define M2 4 // expected-warning {{redefined}}19 // expected-note@-6 {{previous}}20 21#else22 23// Use the error to verify it was parsed.24int x = M1; // expected-note {{previous}}25int x = M2; // expected-error {{redefinition}}26 27#endif28