~shimon/dismaltc

ref: 1ed81693aae22a7be0136e601ee14b226cce74d4 dismaltc/clang/test/Misc/tabstop.c -rw-r--r-- 1.4 KiB
1ed81693Itoh Shimon oops, re-enabled more tests. 1 year, 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// RUN: %clang_cc1 -ftabstop 3 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-3 -strict-whitespace %s
// RUN: %clang_cc1 -ftabstop 4 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-4 -strict-whitespace %s
// RUN: %clang_cc1 -ftabstop 5 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-5 -strict-whitespace %s

// tab
	void* a = 1;

// tab tab
		void* b = 1;

// 3x space tab
   	void* c = 1;

// tab at column 10
void* d =	1;

//CHECK-3: {{^   void\* a = 1;}}
//CHECK-3: {{^      void\* b = 1;}}
//CHECK-3: {{^      void\* c = 1;}}
//CHECK-3: {{^void\* d =   1;}}

//CHECK-4: {{^    void\* a = 1;}}
//CHECK-4: {{^        void\* b = 1;}}
//CHECK-4: {{^    void\* c = 1;}}
//CHECK-4: {{^void\* d =   1;}}

//CHECK-5: {{^     void\* a = 1;}}
//CHECK-5: {{^          void\* b = 1;}}
//CHECK-5: {{^     void\* c = 1;}}
//CHECK-5: {{^void\* d = 1;}}

// Test code modification hints

void f(void)
{
	if (0	& 1	== 1)
	{}

	if (1 == 0	& 1)
	{}
}

// CHECK-3: {{^   }}if (0 & 1   == 1)
// CHECK-3: {{^   }}        (       )
// CHECK-3: {{^   }}if (1 == 0  & 1)
// CHECK-3: {{^   }}    (     )

// CHECK-4: {{^    }}if (0   & 1 == 1)
// CHECK-4: {{^    }}          (     )
// CHECK-4: {{^    }}if (1 == 0  & 1)
// CHECK-4: {{^    }}    (     )

// CHECK-5: {{^     }}if (0     & 1  == 1)
// CHECK-5: {{^     }}            (      )
// CHECK-5: {{^     }}if (1 == 0     & 1)
// CHECK-5: {{^     }}    (     )