mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This diagnostic is useful around silgen_name where it validates that we do not have any weird collisions. Sadly, it just points where one of the conflicting elements is... with this patch, we also emit an error on the other function if we have a SILLocation.
22 lines
494 B
Swift
22 lines
494 B
Swift
// RUN: %target-swift-emit-silgen %s -o /dev/null -verify
|
|
|
|
@_silgen_name("foo")
|
|
func a(_ x: Int) -> Int { // expected-note {{other definition here}}
|
|
return x
|
|
}
|
|
|
|
@_silgen_name("foo")
|
|
func b(_ x: Int) -> Int { // expected-error {{multiple definitions of symbol 'foo'}}
|
|
return x
|
|
}
|
|
|
|
@_cdecl("bar")
|
|
func c(_ x: Int) -> Int { // expected-note {{other definition here}}
|
|
return x
|
|
}
|
|
|
|
@_cdecl("bar")
|
|
func d(_ x: Int) -> Int { // expected-error {{multiple definitions of symbol 'bar'}}
|
|
return x
|
|
}
|