2018-01-24 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / go.test / test / crlf.go
blob2d56889b039abe6927d20f824616414997c782eb
1 // runoutput
3 // Copyright 2011 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Test source files and strings containing \r and \r\n.
9 package main
11 import (
12 "fmt"
13 "strings"
16 func main() {
17 prog = strings.Replace(prog, "BQ", "`", -1)
18 prog = strings.Replace(prog, "CR", "\r", -1)
19 fmt.Print(prog)
22 var prog = `
23 package main
26 import "fmt"
28 var CR s = "hello\n" + CR
29 " world"CR
31 var t = BQhelloCR
32 worldBQ
34 var u = BQhCReCRlCRlCRoCR
35 worldBQ
37 var golden = "hello\n world"
39 func main() {
40 if s != golden {
41 fmt.Printf("s=%q, want %q", s, golden)
43 if t != golden {
44 fmt.Printf("t=%q, want %q", t, golden)
46 if u != golden {
47 fmt.Printf("u=%q, want %q", u, golden)