mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Prints a regular error instead of crashing. The check is done in SILGen, because it's simple. We could also do it earlier, but I don't see a strong reason for this. rdar://75950093
22 lines
408 B
Swift
22 lines
408 B
Swift
// RUN: %target-swift-emit-silgen %s -o /dev/null -verify
|
|
|
|
@_silgen_name("foo")
|
|
func a(_ x: Int) -> Int {
|
|
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 {
|
|
return x
|
|
}
|
|
|
|
@_cdecl("bar")
|
|
func d(_ x: Int) -> Int { // expected-error {{multiple definitions of symbol 'bar'}}
|
|
return x
|
|
}
|