• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -ftabstop 3 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-3 -strict-whitespace %s
2 // RUN: %clang_cc1 -ftabstop 4 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-4 -strict-whitespace %s
3 // RUN: %clang_cc1 -ftabstop 5 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-5 -strict-whitespace %s
4 
5 // tab
6 	void* a = 1;
7 
8 // tab tab
9 		void* b = 1;
10 
11 // 3x space tab
12    	void* c = 1;
13 
14 // tab at column 10
15 void* d =	1;
16 
17 //CHECK-3: {{^   void\* a = 1;}}
18 //CHECK-3: {{^      void\* b = 1;}}
19 //CHECK-3: {{^      void\* c = 1;}}
20 //CHECK-3: {{^void\* d =   1;}}
21 
22 //CHECK-4: {{^    void\* a = 1;}}
23 //CHECK-4: {{^        void\* b = 1;}}
24 //CHECK-4: {{^    void\* c = 1;}}
25 //CHECK-4: {{^void\* d =   1;}}
26 
27 //CHECK-5: {{^     void\* a = 1;}}
28 //CHECK-5: {{^          void\* b = 1;}}
29 //CHECK-5: {{^     void\* c = 1;}}
30 //CHECK-5: {{^void\* d = 1;}}
31 
32 // Test code modification hints
33 
f(void)34 void f(void)
35 {
36 	if (0	& 1	== 1)
37 	{}
38 
39 	if (1 == 0	& 1)
40 	{}
41 }
42 
43 // CHECK-3: {{^   }}if (0 & 1   == 1)
44 // CHECK-3: {{^   }}        (       )
45 // CHECK-3: {{^   }}if (1 == 0  & 1)
46 // CHECK-3: {{^   }}    (     )
47 
48 // CHECK-4: {{^    }}if (0   & 1 == 1)
49 // CHECK-4: {{^    }}          (     )
50 // CHECK-4: {{^    }}if (1 == 0  & 1)
51 // CHECK-4: {{^    }}    (     )
52 
53 // CHECK-5: {{^     }}if (0     & 1  == 1)
54 // CHECK-5: {{^     }}            (      )
55 // CHECK-5: {{^     }}if (1 == 0     & 1)
56 // CHECK-5: {{^     }}    (     )
57