From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Misc/tabstop.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 clang/test/Misc/tabstop.c (limited to 'clang/test/Misc/tabstop.c') diff --git a/clang/test/Misc/tabstop.c b/clang/test/Misc/tabstop.c new file mode 100644 index 0000000..49c4d7b --- /dev/null +++ b/clang/test/Misc/tabstop.c @@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -ftabstop 3 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=3 -strict-whitespace %s +// RUN: %clang_cc1 -ftabstop 4 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=4 -strict-whitespace %s +// RUN: %clang_cc1 -ftabstop 5 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=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) + {} +} + +// CHECK-3: {{^ }}if (0 & 1 == 1) +// CHECK-3: {{^ }} ( ) + +// CHECK-4: {{^ }}if (0 & 1 == 1) +// CHECK-4: {{^ }} ( ) + +// CHECK-5: {{^ }}if (0 & 1 == 1) +// CHECK-5: {{^ }} ( ) -- cgit v1.2.3