| 1 |
// RUN: %clang_cc1 -E -x c %s | FileCheck %s |
| 2 |
// RUN: %clang_cc1 -x c -fsyntax-only %s -verify |
| 3 |
// RUN: %clang_cc1 -x cpp-output -fsyntax-only -verify %s |
| 4 |
// expected-no-diagnostics |
| 5 |
|
| 6 |
// The preprocessor does not expand macro-identifiers in #pragma directives. |
| 7 |
// When we preprocess & parse the code, clang expands the macros in directives. |
| 8 |
// When we parse already preprocessed code, clang still has to expand the |
| 9 |
// macros in the directives. |
| 10 |
// This means that we're not always able to parse the preprocessor's output |
| 11 |
// without preserving the definitions (-dD). |
| 12 |
|
| 13 |
#define FACTOR 4 |
| 14 |
|
| 15 |
void foo() { |
| 16 |
// CHECK: #pragma unroll FACTOR |
| 17 |
#pragma unroll FACTOR |
| 18 |
for(;;) { |
| 19 |
} |
| 20 |
return; |
| 21 |
} |