File tree Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ namespace swift {
96
96
97
97
// / If true, '#file' evaluates to the full path rather than a
98
98
// / human-readable string.
99
- bool MagicFileIdentifierEvaluatesToPath = false ;
99
+ bool MagicFileIdentifierEvaluatesToPath = true ;
100
100
101
101
// /
102
102
// / Support for alternate usage modes
Original file line number Diff line number Diff line change 13
13
14
14
func f( ) -> Int {
15
15
fatalError ( )
16
- // CRASH-CHECK: {{[fF]}}atal error: file main.swift (main) , line [[@LINE-1]]
16
+ // CRASH-CHECK: {{[fF]}}atal error: file {{.*}}/ main.swift, line [[@LINE-1]]
17
17
}
18
18
19
19
f ( )
Original file line number Diff line number Diff line change 15
15
func f( crash crash: Bool ) -> Int {
16
16
if crash {
17
17
return < #T#>
18
- // CRASH-CHECK: {{[fF]}}atal error: attempt to evaluate editor placeholder: file main.swift (main) , line [[@LINE-1]]
18
+ // CRASH-CHECK: {{[fF]}}atal error: attempt to evaluate editor placeholder: file {{.*}}/ main.swift, line [[@LINE-1]]
19
19
} else {
20
20
return 42
21
21
}
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-emit-silgen -pound-file=path -module-name Foo %s | %FileCheck --check-prefixes=BOTH,PATH %s
2
+ // RUN: %target-swift-emit-silgen -pound-file=compact -module-name Foo %s | %FileCheck --check-prefixes=BOTH,COMPACT %s
3
+ // RUN: not %target-swift-emit-silgen -pound-file=zyzyx -module-name Foo %s 2>&1 | %FileCheck --check-prefix=ZYZYX %s
4
+
5
+ // RUN: %target-swift-emit-silgen -pound-file path -module-name Foo %s | %FileCheck --check-prefixes=BOTH,PATH %s
6
+ // RUN: %target-swift-emit-silgen -pound-file compact -module-name Foo %s | %FileCheck --check-prefixes=BOTH,COMPACT %s
7
+ // RUN: not %target-swift-emit-silgen -pound-file zyzyx -module-name Foo %s 2>&1 | %FileCheck --check-prefix=ZYZYX %s
8
+
9
+ // RUN: %target-swift-emit-silgen %s -module-name Foo | %FileCheck --check-prefixes=BOTH,COMPACT %s
10
+
11
+ // ZYZYX: error: invalid value 'zyzyx' in '-pound-file'
12
+
13
+ func directUse( ) {
14
+ // BOTH-LABEL: sil {{.*}} @$s3Foo9directUseyyF
15
+ print ( #file)
16
+ // PATH: string_literal utf8 "SOURCE_DIR/test/SILGen/magic_identifier_file.swift"
17
+ // COMPACT: string_literal utf8 "magic_identifier_file.swift (Foo)"
18
+ }
19
+
20
+ func indirectUse( ) {
21
+ // BOTH-LABEL: sil {{.*}} @$s3Foo11indirectUseyyF
22
+ fatalError ( )
23
+ // PATH: string_literal utf8 "SOURCE_DIR/test/SILGen/magic_identifier_file.swift"
24
+ // COMPACT: string_literal utf8 "magic_identifier_file.swift (Foo)"
25
+ }
You can’t perform that action at this time.
0 commit comments