150
|
1 // RUN: not llvm-tblgen -DDIAG1 -I %p %s 2>&1 | FileCheck --check-prefixes=DIAG1 %s
|
|
2 // RUN: not llvm-tblgen -DDIAG4 -I %p %s 2>&1 | FileCheck --check-prefixes=DIAG4 %s
|
|
3 // RUN: not llvm-tblgen -DDIAG2 -I %p %s 2>&1 | FileCheck --check-prefixes=DIAG2 %s
|
|
4 // RUN: not llvm-tblgen -I %p %s 2>&1 | FileCheck --check-prefixes=DIAG3 %s
|
|
5
|
|
6 #ifdef DIAG1
|
|
7 // DIAG1: error: Only comments are supported after #define NAME
|
|
8 #define ENABLED1/*
|
|
9 */class C;
|
|
10 #endif // DIAG1
|
|
11
|
|
12 #ifdef DIAG4
|
|
13 // DIAG4: warning: Duplicate definition of macro: ENABLED1
|
|
14 #define ENABLED1
|
|
15 #define ENABLED1
|
|
16 #endif // DIAG4
|
|
17
|
|
18 #ifdef DIAG2
|
|
19 // DIAG2: error: Only comments are supported after #ifdef NAME
|
|
20
|
|
21 // Invalid #ifdef below should be detected even if DIAG2 is not defined.
|
|
22 // DIAG3: error: Only comments are supported after #ifdef NAME
|
|
23 #ifdef DIAG2/*
|
|
24 */class C;
|
|
25 #endif
|
|
26 #endif // DIAG2
|