brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 7bf06ae Raw
48 lines · c
1// Test this without pch.2// RUN: %clang_cc1 -include %s -fsyntax-only -verify %s3 4// Test with pch.5// RUN: %clang_cc1 -emit-pch -o %t %s6// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s 7 8#ifndef HEADER9#define HEADER10 11extern float y;12extern int *ip, x;13 14float z;15 16int z2 = 17;17 18#define MAKE_HAPPY(X) X##Happy19int MAKE_HAPPY(Very);20 21#define A_MACRO_IN_THE_PCH 49222#define FUNCLIKE_MACRO(X, Y) X ## Y23 24#define PASTE2(x,y) x##y25#define PASTE1(x,y) PASTE2(x,y)26#define UNIQUE(x) PASTE1(x,__COUNTER__)27 28int UNIQUE(a);  // a029int UNIQUE(a);  // a130 31#else32 33int *ip2 = &x;34float *fp = &ip; // expected-error{{incompatible pointer types}}35double z; // expected-error{{redefinition}} expected-note@14{{previous}}36int z2 = 18; // expected-error{{redefinition}} expected-note@16{{previous}}37double VeryHappy; // expected-error{{redefinition}} expected-note@19{{previous definition is here}}38 39int Q = A_MACRO_IN_THE_PCH;40 41int R = FUNCLIKE_MACRO(A_MACRO_, IN_THE_PCH);42 43 44int UNIQUE(a);  // a245int *Arr[] = { &a0, &a1, &a2 };46 47#endif48