summaryrefslogtreecommitdiff
path: root/clang/test/Lexer/pragma-operators.cpp
blob: d1645adbc252970d29be26dd013a9e250ed42b29 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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. <rdar://problem/8412013>

// 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)