brintos

brintos / llvm-project-archived public Read only

0
0
Text · 749 B · 18f0266 Raw
28 lines · c
1// RUN: %clang_cc1 -fsyntax-only -std=c99 -pedantic-errors %s2// RUN: %clang_cc1 -std=c99 -emit-pch -o %t %s3// RUN: %clang_cc1 -fsyntax-only -std=c99 -pedantic-errors -include-pch %t %s4 5// RUN: %clang_cc1 -fsyntax-only -std=c99 -pedantic-errors -DINCLUDED %s -verify6// This last one should warn for -Wempty-translation-unit (C99 6.9p1).7 8#if defined(INCLUDED)9 10// empty except for the prefix header11 12#elif defined(HEADER)13 14typedef int my_int;15#define INCLUDED16 17#else18 19#define HEADER20#include "empty-with-headers.c"21// empty except for the header22 23#endif24 25// This should only fire if the header is not included,26// either explicitly or as a prefix header.27// expected-error{{ISO C requires a translation unit to contain at least one declaration}}28