mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 02:06:07 +00:00

The '#pragma once' directive was erroneously ignored when encountered in the header-file specified in generate-PCH-mode. This resulted in compile-time errors in some cases with legal code, and also a misleading warning being produced. Patch by Warren Ristow! Differential Revision: http://reviews.llvm.org/D19815 llvm-svn: 276653
14 lines
438 B
C
14 lines
438 B
C
// Test this without pch.
|
|
// RUN: %clang_cc1 -include %S/Inputs/pragma-once.h -fsyntax-only -verify %s
|
|
|
|
// Test with pch.
|
|
// RUN: %clang_cc1 -emit-pch -o %t %S/Inputs/pragma-once.h
|
|
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
|
|
|
|
// expected-no-diagnostics
|
|
|
|
// Including "pragma-once.h" twice, to verify the 'once' aspect is honored.
|
|
#include "Inputs/pragma-once.h"
|
|
#include "Inputs/pragma-once.h"
|
|
int foo(void) { return 0; }
|