Files
swift-mirror/test/ClangModules/macros_redef.swift
Doug Gregor 4c6d972691 Clang importer: collapse redefined macros.
In C, macros can be redefined so long as the redefinitions are
tokenwise equivalent. Provide the Clang importer with the same ability by
determining when tokenwise equivalent macros would be imported as
different Swift declarations, and collapse them into a single
declaration.
2015-12-21 14:43:46 -08:00

12 lines
269 B
Swift

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/custom-modules -parse -verify %s
import MacrosRedefA
import MacrosRedefB
func testMacroRedef() {
var s: String
s = REDEF_1
s = REDEF_2 // expected-error{{ambiguous use of 'REDEF_2'}}
}