Skip to content

Commit

Permalink
Fix issues with git converting CRLF to CR
Browse files Browse the repository at this point in the history
UI tests now run on asmjs-unknown-emscripten, ignore tests with inline assembly which is not supported on emscripten targets
  • Loading branch information
petrochenkov committed Jul 27, 2019
1 parent 42a317a commit f1c8673
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 49 deletions.
3 changes: 2 additions & 1 deletion src/test/ui/.gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
trailing-carriage-return-in-string.rs -text
lexer-crlf-line-endings-string-literal-doc-comment.rs -text
trailing-carriage-return-in-string.rs -text
2 changes: 2 additions & 0 deletions src/test/ui/error-codes/E0661.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore-emscripten

#![feature(asm)]

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0661.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0661]: output operand constraint lacks '=' or '+'
--> $DIR/E0661.rs:5:18
--> $DIR/E0661.rs:7:18
|
LL | asm!("nop" : "r"(a));
| ^^^
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/error-codes/E0662.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore-emscripten

#![feature(asm)]

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0662.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0662]: input operand constraint contains '='
--> $DIR/E0662.rs:6:12
--> $DIR/E0662.rs:8:12
|
LL | : "=test"("a")
| ^^^^^^^
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/error-codes/E0663.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore-emscripten

#![feature(asm)]

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0663.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0663]: input operand constraint contains '+'
--> $DIR/E0663.rs:6:12
--> $DIR/E0663.rs:8:12
|
LL | : "+test"("a")
| ^^^^^^^
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/error-codes/E0664.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore-emscripten

#![feature(asm)]

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0664.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0664]: clobber should not be surrounded by braces
--> $DIR/E0664.rs:7:12
--> $DIR/E0664.rs:9:12
|
LL | : "{eax}"
| ^^^^^^^
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/feature-gates/feature-gate-asm.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore-emscripten

fn main() {
unsafe {
asm!(""); //~ ERROR inline assembly is not stable enough
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/feature-gates/feature-gate-asm.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: use of unstable library feature 'asm': inline assembly is not stable enough for use and is subject to change
--> $DIR/feature-gate-asm.rs:3:9
--> $DIR/feature-gate-asm.rs:5:9
|
LL | asm!("");
| ^^^
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/feature-gates/feature-gate-asm2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// gate-test-asm
// ignore-emscripten

fn main() {
unsafe {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/feature-gates/feature-gate-asm2.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: use of unstable library feature 'asm': inline assembly is not stable enough for use and is subject to change
--> $DIR/feature-gate-asm2.rs:5:26
--> $DIR/feature-gate-asm2.rs:6:26
|
LL | println!("{:?}", asm!(""));
| ^^^
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/issues/issue-53787-inline-assembler-macro.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Regression test for Issue #53787: Fix ICE when creating a label in inline assembler with macros.

// ignore-emscripten

#![feature(asm)]

macro_rules! fake_jump {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0669]: invalid value for constraint in inline assembly
--> $DIR/issue-53787-inline-assembler-macro.rs:21:16
--> $DIR/issue-53787-inline-assembler-macro.rs:23:16
|
LL | fake_jump!("FirstFunc");
| ^^^^^^^^^^^
Expand Down
82 changes: 41 additions & 41 deletions src/test/ui/lexer-crlf-line-endings-string-literal-doc-comment.rs
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
// run-pass
// ignore-tidy-cr ignore-license
// ignore-tidy-cr (repeated again because of tidy bug)
// license is ignored because tidy can't handle the CRLF here properly.

// http://rust-lang.org/COPYRIGHT.
//

// N.B., this file needs CRLF line endings. The .gitattributes file in
// this directory should enforce it.

// ignore-pretty issue #37195

/// Doc comment that ends in CRLF
pub fn foo() {}

/** Block doc comment that
* contains CRLF characters
*/
pub fn bar() {}

fn main() {
let s = "string
literal";
assert_eq!(s, "string\nliteral");

let s = "literal with \
escaped newline";
assert_eq!(s, "literal with escaped newline");

let s = r"string
literal";
assert_eq!(s, "string\nliteral");
let s = br"byte string
literal";
assert_eq!(s, "byte string\nliteral".as_bytes());

// validate that our source file has CRLF endings
let source = include_str!("lexer-crlf-line-endings-string-literal-doc-comment.rs");
assert!(source.contains("string\r\nliteral"));
}
// run-pass
// ignore-tidy-cr ignore-license
// ignore-tidy-cr (repeated again because of tidy bug)
// license is ignored because tidy can't handle the CRLF here properly.

// http://rust-lang.org/COPYRIGHT.
//

// N.B., this file needs CRLF line endings. The .gitattributes file in
// this directory should enforce it.

// ignore-pretty issue #37195

/// Doc comment that ends in CRLF
pub fn foo() {}

/** Block doc comment that
* contains CRLF characters
*/
pub fn bar() {}

fn main() {
let s = "string
literal";
assert_eq!(s, "string\nliteral");

let s = "literal with \
escaped newline";
assert_eq!(s, "literal with escaped newline");

let s = r"string
literal";
assert_eq!(s, "string\nliteral");
let s = br"byte string
literal";
assert_eq!(s, "byte string\nliteral".as_bytes());

// validate that our source file has CRLF endings
let source = include_str!("lexer-crlf-line-endings-string-literal-doc-comment.rs");
assert!(source.contains("string\r\nliteral"));
}

0 comments on commit f1c8673

Please sign in to comment.