bef7762723
clang does warn about backslash-followed-by-tab.
74 lines
1.8 KiB
C
74 lines
1.8 KiB
C
//------------------------------------------------------------------------------
|
|
// CLING - the C++ LLVM-based InterpreterG :)
|
|
//
|
|
// This file is dual-licensed: you can choose to license it under the University
|
|
// of Illinois Open Source License or the GNU Lesser General Public License. See
|
|
// LICENSE.TXT for details.
|
|
//------------------------------------------------------------------------------
|
|
|
|
// RUN: cat %s | %cling -Xclang -verify 2>&1 | FileCheck %s
|
|
// Tests continuation of a line with , or \
|
|
// Be careful saving this file: some editors strip the trailing spaces at bottom
|
|
|
|
extern "C" int printf(const char*, ...);
|
|
|
|
int Ac = 15,
|
|
Bc = 25,
|
|
Cc = 35;
|
|
|
|
Ac
|
|
// CHECK: (int) 15
|
|
Bc
|
|
// CHECK-NEXT: (int) 25
|
|
Cc
|
|
// CHECK-NEXT: (int) 35
|
|
|
|
static void InvokeTest(int A,
|
|
int B) { printf("Invoke: %d, %d\n", A, B); }
|
|
InvokeTest(Ac,
|
|
Bc);
|
|
// CHECK-NEXT: Invoke: 15, 25
|
|
|
|
int A = 10, \
|
|
B = 20, \
|
|
C = 30;
|
|
|
|
A
|
|
// CHECK-NEXT: (int) 10
|
|
B
|
|
// CHECK-NEXT: (int) 20
|
|
C
|
|
// CHECK-NEXT: (int) 30
|
|
|
|
#define CLING_MULTILINE_STRING "A" \
|
|
"B" \
|
|
" C D"
|
|
|
|
CLING_MULTILINE_STRING
|
|
// CHECK-NEXT: (const char [7]) "AB C D"
|
|
|
|
"Multinline" \
|
|
" String " \
|
|
"Constant"
|
|
"Separate"
|
|
|
|
// CHECK-NEXT: (const char [27]) "Multinline String Constant"
|
|
// CHECK-NEXT: (const char [9]) "Separate"
|
|
|
|
// Common error handling macro
|
|
#define CLING_MULTILINE_MACRO(STR) do { \
|
|
printf(STR "\n"); } while(0)
|
|
|
|
CLING_MULTILINE_MACRO("DOWHILE");
|
|
// CHECK-NEXT: DOWHILE
|
|
|
|
#define CLING_MULTILINE_TRAILING_SPACE \
|
|
"Trailing Space " \
|
|
"And A Tab" \
|
|
" End" // expected-warning@1 {{backslash and newline separated by space}} // expected-warning@2 {{backslash and newline separated by space}}
|
|
|
|
CLING_MULTILINE_TRAILING_SPACE
|
|
// CHECK-NEXT: (const char [29]) "Trailing Space And A Tab End"
|
|
|
|
.q
|