[PATCH] D61496: Fixed tests where grep was not matching the linefeed

2019-05-10 Thread Alexandre Ganea via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC360467: Fixed tests where grep was not matching the linefeed 
(authored by aganea, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61496?vs=197990=199069#toc

Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61496/new/

https://reviews.llvm.org/D61496

Files:
  test/Preprocessor/indent_macro.c
  test/Preprocessor/macro_fn_varargs_named.c
  test/Preprocessor/macro_not_define.c
  test/Preprocessor/macro_rparen_scan.c


Index: test/Preprocessor/macro_rparen_scan.c
===
--- test/Preprocessor/macro_rparen_scan.c
+++ test/Preprocessor/macro_rparen_scan.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^3 ;$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK:3 ;
 
 /* Right paren scanning, hard case.  Should expand to 3. */
 #define i(x) 3 
Index: test/Preprocessor/macro_fn_varargs_named.c
===
--- test/Preprocessor/macro_fn_varargs_named.c
+++ test/Preprocessor/macro_fn_varargs_named.c
@@ -1,6 +1,9 @@
-// RUN: %clang_cc1 -E %s | grep '^a: x$'
-// RUN: %clang_cc1 -E %s | grep '^b: x y, z,h$'
-// RUN: %clang_cc1 -E %s | grep '^c: foo(x)$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix CHECK-1
+// CHECK-1:a: x
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix CHECK-2
+// CHECK-2:b: x y, z,h
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix CHECK-3
+// CHECK-3:c: foo(x)
 
 #define A(b, c...) b c
 a: A(x)
Index: test/Preprocessor/macro_not_define.c
===
--- test/Preprocessor/macro_not_define.c
+++ test/Preprocessor/macro_not_define.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^ # define X 3$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK: # define X 3
 
 #define H # 
  #define D define 
Index: test/Preprocessor/indent_macro.c
===
--- test/Preprocessor/indent_macro.c
+++ test/Preprocessor/indent_macro.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^   zzap$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK:   zzap
 
 // zzap is on a new line, should be indented.
 #define BLAH  zzap


Index: test/Preprocessor/macro_rparen_scan.c
===
--- test/Preprocessor/macro_rparen_scan.c
+++ test/Preprocessor/macro_rparen_scan.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^3 ;$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK:3 ;
 
 /* Right paren scanning, hard case.  Should expand to 3. */
 #define i(x) 3 
Index: test/Preprocessor/macro_fn_varargs_named.c
===
--- test/Preprocessor/macro_fn_varargs_named.c
+++ test/Preprocessor/macro_fn_varargs_named.c
@@ -1,6 +1,9 @@
-// RUN: %clang_cc1 -E %s | grep '^a: x$'
-// RUN: %clang_cc1 -E %s | grep '^b: x y, z,h$'
-// RUN: %clang_cc1 -E %s | grep '^c: foo(x)$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace --check-prefix CHECK-1
+// CHECK-1:a: x
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace --check-prefix CHECK-2
+// CHECK-2:b: x y, z,h
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace --check-prefix CHECK-3
+// CHECK-3:c: foo(x)
 
 #define A(b, c...) b c
 a: A(x)
Index: test/Preprocessor/macro_not_define.c
===
--- test/Preprocessor/macro_not_define.c
+++ test/Preprocessor/macro_not_define.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^ # define X 3$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK: # define X 3
 
 #define H # 
  #define D define 
Index: test/Preprocessor/indent_macro.c
===
--- test/Preprocessor/indent_macro.c
+++ test/Preprocessor/indent_macro.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^   zzap$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK:   zzap
 
 // zzap is on a new line, should be indented.
 #define BLAH  zzap
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61496: Fixed tests where grep was not matching the linefeed

2019-05-06 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea marked an inline comment as done.
aganea added inline comments.



Comment at: clang/trunk/test/Preprocessor/indent_macro.c:1-2
-// RUN: %clang_cc1 -E %s | grep '^   zzap$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK:   zzap
 

lebedev.ri wrote:
> Separate with newline
What do you mean? Between RUN and CHECK? There's already a newline a L3.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61496/new/

https://reviews.llvm.org/D61496



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61496: Fixed tests where grep was not matching the linefeed

2019-05-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

Sure, this looks better.




Comment at: clang/trunk/test/Preprocessor/indent_macro.c:1-2
-// RUN: %clang_cc1 -E %s | grep '^   zzap$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK:   zzap
 

Separate with newline



Comment at: clang/trunk/test/Preprocessor/macro_fn_varargs_named.c:1-6
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix 1
+// 1:a: x
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix 2
+// 2:b: x y, z,h
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix 3
+// 3:c: foo(x)

```
// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix CHECK-1
// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix CHECK-2
// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix CHECK-3

// CHECK-1:a: x
// CHECK-2:b: x y, z,h
// CHECK-3:c: foo(x)
```


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61496/new/

https://reviews.llvm.org/D61496



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61496: Fixed tests where grep was not matching the linefeed

2019-05-03 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea added a comment.

In D61496#1489523 , @probinson wrote:

> Checked-in files should not have CRLF endings, in general (there are a very 
> few exceptions, and these aren't among them).
>  If the checked-in files have LF endings but your tool checks them out with 
> CRLF then that is a problem with your config, or with the tool.
>  Adding dos2unix to the RUN lines is the wrong fix, either way.


Yeah I've realized that :) This is caused by svn on Windows which sets 
`svn:eol-style=native` by default, which causes local files to be saved in the 
"native" format, which is CRLF on Windows (even though in upstream they are LF) 
When files are commited, normally svn should convert them back to LF (or at 
least that's the contract 
 
for `svn:eol-style=native`).

  native
  This causes the file to contain the EOL markers that are native to the 
operating system on which Subversion was run. In other words, if a user on a 
Windows machine checks out a working copy that contains a file with an 
svn:eol-style property set to native, that file will contain CRLF EOL markers. 
A Unix user checking out a working copy that contains the same file will see LF 
EOL markers in his copy of the file.
  
  Note that Subversion will actually store the file in the repository using 
normalized LF EOL markers regardless of the operating system. This is basically 
transparent to the user, though.

I'm using the MINGW32 bash to run the tests/`check-all` because it comes with 
all the Unix tools (grep, sed, ...) that Windows doesn't have.
The bug here is that the GNU grep only matches LF, not CRLF.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61496/new/

https://reviews.llvm.org/D61496



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61496: Fixed tests where grep was not matching the linefeed

2019-05-03 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea updated this revision to Diff 197990.
aganea added a comment.

Changed to use `FileCheck` instead of `grep`


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61496/new/

https://reviews.llvm.org/D61496

Files:
  clang/trunk/test/Preprocessor/indent_macro.c
  clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
  clang/trunk/test/Preprocessor/macro_not_define.c
  clang/trunk/test/Preprocessor/macro_rparen_scan.c


Index: clang/trunk/test/Preprocessor/macro_rparen_scan.c
===
--- clang/trunk/test/Preprocessor/macro_rparen_scan.c
+++ clang/trunk/test/Preprocessor/macro_rparen_scan.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^3 ;$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK:3 ;
 
 /* Right paren scanning, hard case.  Should expand to 3. */
 #define i(x) 3 
Index: clang/trunk/test/Preprocessor/macro_not_define.c
===
--- clang/trunk/test/Preprocessor/macro_not_define.c
+++ clang/trunk/test/Preprocessor/macro_not_define.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^ # define X 3$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK: # define X 3
 
 #define H # 
  #define D define 
Index: clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
===
--- clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
+++ clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
@@ -1,6 +1,9 @@
-// RUN: %clang_cc1 -E %s | grep '^a: x$'
-// RUN: %clang_cc1 -E %s | grep '^b: x y, z,h$'
-// RUN: %clang_cc1 -E %s | grep '^c: foo(x)$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix 1
+// 1:a: x
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix 2
+// 2:b: x y, z,h
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace 
--check-prefix 3
+// 3:c: foo(x)
 
 #define A(b, c...) b c
 a: A(x)
Index: clang/trunk/test/Preprocessor/indent_macro.c
===
--- clang/trunk/test/Preprocessor/indent_macro.c
+++ clang/trunk/test/Preprocessor/indent_macro.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^   zzap$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK:   zzap
 
 // zzap is on a new line, should be indented.
 #define BLAH  zzap


Index: clang/trunk/test/Preprocessor/macro_rparen_scan.c
===
--- clang/trunk/test/Preprocessor/macro_rparen_scan.c
+++ clang/trunk/test/Preprocessor/macro_rparen_scan.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^3 ;$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK:3 ;
 
 /* Right paren scanning, hard case.  Should expand to 3. */
 #define i(x) 3 
Index: clang/trunk/test/Preprocessor/macro_not_define.c
===
--- clang/trunk/test/Preprocessor/macro_not_define.c
+++ clang/trunk/test/Preprocessor/macro_not_define.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^ # define X 3$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK: # define X 3
 
 #define H # 
  #define D define 
Index: clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
===
--- clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
+++ clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
@@ -1,6 +1,9 @@
-// RUN: %clang_cc1 -E %s | grep '^a: x$'
-// RUN: %clang_cc1 -E %s | grep '^b: x y, z,h$'
-// RUN: %clang_cc1 -E %s | grep '^c: foo(x)$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace --check-prefix 1
+// 1:a: x
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace --check-prefix 2
+// 2:b: x y, z,h
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace --check-prefix 3
+// 3:c: foo(x)
 
 #define A(b, c...) b c
 a: A(x)
Index: clang/trunk/test/Preprocessor/indent_macro.c
===
--- clang/trunk/test/Preprocessor/indent_macro.c
+++ clang/trunk/test/Preprocessor/indent_macro.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s | grep '^   zzap$'
+// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace
+// CHECK:   zzap
 
 // zzap is on a new line, should be indented.
 #define BLAH  zzap
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61496: Fixed tests where grep was not matching the linefeed

2019-05-03 Thread Paul Robinson via Phabricator via cfe-commits
probinson added a comment.

Checked-in files should not have CRLF endings, in general (there are a very few 
exceptions, and these aren't among them).
If the checked-in files have LF endings but your tool checks them out with CRLF 
then that is a problem with your config, or with the tool.
Adding dos2unix to the RUN lines is the wrong fix, either way.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61496/new/

https://reviews.llvm.org/D61496



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61496: Fixed tests where grep was not matching the linefeed

2019-05-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri requested changes to this revision.
lebedev.ri added a comment.
This revision now requires changes to proceed.

The tests should be fixed to use `FileCheck`.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61496/new/

https://reviews.llvm.org/D61496



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61496: Fixed tests where grep was not matching the linefeed

2019-05-03 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea created this revision.
aganea added reviewers: rnk, jlebar.
aganea added a project: clang.
Herald added a subscriber: mstorsjo.
aganea edited the summary of this revision.

The files below have been synced by Tortoise as CRLF, and it looks like they 
are like that in the depot as well (I'm still using the SVN setup)
Strangely `svn diff` shows them as LF.
The issue is that `grep 'something$'` doesn't match the newline inside the 
MINGW32 bash (mintty).


Repository:
  rC Clang

https://reviews.llvm.org/D61496

Files:
  clang/trunk/test/Preprocessor/indent_macro.c
  clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
  clang/trunk/test/Preprocessor/macro_not_define.c
  clang/trunk/test/Preprocessor/macro_rparen_scan.c


Index: clang/trunk/test/Preprocessor/macro_rparen_scan.c
===
--- clang/trunk/test/Preprocessor/macro_rparen_scan.c
+++ clang/trunk/test/Preprocessor/macro_rparen_scan.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -E %s | grep '^3 ;$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^3 ;$'
 
 /* Right paren scanning, hard case.  Should expand to 3. */
 #define i(x) 3 
Index: clang/trunk/test/Preprocessor/macro_not_define.c
===
--- clang/trunk/test/Preprocessor/macro_not_define.c
+++ clang/trunk/test/Preprocessor/macro_not_define.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -E %s | grep '^ # define X 3$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^ # define X 3$'
 
 #define H # 
  #define D define 
Index: clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
===
--- clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
+++ clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -E %s | grep '^a: x$'
-// RUN: %clang_cc1 -E %s | grep '^b: x y, z,h$'
-// RUN: %clang_cc1 -E %s | grep '^c: foo(x)$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^a: x$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^b: x y, z,h$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^c: foo(x)$'
 
 #define A(b, c...) b c
 a: A(x)
Index: clang/trunk/test/Preprocessor/indent_macro.c
===
--- clang/trunk/test/Preprocessor/indent_macro.c
+++ clang/trunk/test/Preprocessor/indent_macro.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -E %s | grep '^   zzap$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^   zzap$'
 
 // zzap is on a new line, should be indented.
 #define BLAH  zzap


Index: clang/trunk/test/Preprocessor/macro_rparen_scan.c
===
--- clang/trunk/test/Preprocessor/macro_rparen_scan.c
+++ clang/trunk/test/Preprocessor/macro_rparen_scan.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -E %s | grep '^3 ;$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^3 ;$'
 
 /* Right paren scanning, hard case.  Should expand to 3. */
 #define i(x) 3 
Index: clang/trunk/test/Preprocessor/macro_not_define.c
===
--- clang/trunk/test/Preprocessor/macro_not_define.c
+++ clang/trunk/test/Preprocessor/macro_not_define.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -E %s | grep '^ # define X 3$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^ # define X 3$'
 
 #define H # 
  #define D define 
Index: clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
===
--- clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
+++ clang/trunk/test/Preprocessor/macro_fn_varargs_named.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -E %s | grep '^a: x$'
-// RUN: %clang_cc1 -E %s | grep '^b: x y, z,h$'
-// RUN: %clang_cc1 -E %s | grep '^c: foo(x)$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^a: x$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^b: x y, z,h$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^c: foo(x)$'
 
 #define A(b, c...) b c
 a: A(x)
Index: clang/trunk/test/Preprocessor/indent_macro.c
===
--- clang/trunk/test/Preprocessor/indent_macro.c
+++ clang/trunk/test/Preprocessor/indent_macro.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -E %s | grep '^   zzap$'
+// RUN: %clang_cc1 -E %s | dos2unix | grep '^   zzap$'
 
 // zzap is on a new line, should be indented.
 #define BLAH  zzap
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits