From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Lexer/pragma-operators.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 clang/test/Lexer/pragma-operators.cpp (limited to 'clang/test/Lexer/pragma-operators.cpp') diff --git a/clang/test/Lexer/pragma-operators.cpp b/clang/test/Lexer/pragma-operators.cpp new file mode 100644 index 0000000..d1645ad --- /dev/null +++ b/clang/test/Lexer/pragma-operators.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -fms-extensions -E %s | FileCheck %s + +// Test that we properly expand the C99 _Pragma and Microsoft __pragma +// into #pragma directives, with newlines where needed. + +// CHECK: #line +// CHECK: #pragma warning(push) +// CHECK: extern "C" { +// CHECK: #line +// CHECK: #pragma warning(push) +// CHECK: int foo() { return 0; } } +// CHECK: #line +// CHECK: #pragma warning(pop) +#define A(X) extern "C" { __pragma(warning(push)) \ + int X() { return 0; } \ +} +#define B(X) A(X) +#pragma warning(push) +B(foo) +#pragma warning(pop) -- cgit v1.2.3