[clang] Add test for -ftabstop diagnostics
authorJan Svoboda <jan_svoboda@apple.com>
Wed, 31 May 2023 04:58:00 +0000 (21:58 -0700)
committerJan Svoboda <jan_svoboda@apple.com>
Wed, 31 May 2023 04:58:29 +0000 (21:58 -0700)
I forgot to request a regression test in review of D151429, so adding one myself.

clang/test/Misc/tabstop.c

index 5b9bda9..500bf2a 100644 (file)
@@ -1,6 +1,7 @@
-// RUN: %clang_cc1 -ftabstop 3 -fsyntax-only -Wno-error=int-conversion %s 2>&1 | FileCheck -check-prefix=CHECK-3 -strict-whitespace %s
-// RUN: %clang_cc1 -ftabstop 4 -fsyntax-only -Wno-error=int-conversion %s 2>&1 | FileCheck -check-prefix=CHECK-4 -strict-whitespace %s
-// RUN: %clang_cc1 -ftabstop 5 -fsyntax-only -Wno-error=int-conversion %s 2>&1 | FileCheck -check-prefix=CHECK-5 -strict-whitespace %s
+// RUN: %clang_cc1 -ftabstop 3   -fsyntax-only -Wno-error=int-conversion %s 2>&1 | FileCheck -check-prefix=CHECK-3   -strict-whitespace %s
+// RUN: %clang_cc1 -ftabstop 4   -fsyntax-only -Wno-error=int-conversion %s 2>&1 | FileCheck -check-prefix=CHECK-4   -strict-whitespace %s
+// RUN: %clang_cc1 -ftabstop 5   -fsyntax-only -Wno-error=int-conversion %s 2>&1 | FileCheck -check-prefix=CHECK-5   -strict-whitespace %s
+// RUN: %clang_cc1 -ftabstop 101 -fsyntax-only -Wno-error=int-conversion %s 2>&1 | FileCheck -check-prefix=CHECK-101 -strict-whitespace %s
 
 // tab
        void* a = 1;
@@ -54,3 +55,5 @@ void f(void)
 // CHECK-5: {{^     }}            (      )
 // CHECK-5: {{^     }}if (1 == 0     & 1)
 // CHECK-5: {{^     }}    (     )
+
+// CHECK-101: warning: ignoring invalid -ftabstop value '101', using default value 8