forked from swiftlang/swift
- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInternalChecks.swift
17 lines (13 loc) · 648 Bytes
/
InternalChecks.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %target-swift-frontend -O -parse-stdlib -D INTERNAL_CHECKS_ENABLED -primary-file %s -emit-sil | %FileCheck %s --check-prefix=CHECKS
// RUN: %target-swift-frontend -O -parse-stdlib -primary-file %s -emit-sil | %FileCheck %s --check-prefix=NOCHECKS
import Swift
func test_internal_checks_config(_ x:Int, _ y:Int)->Int{
#if INTERNAL_CHECKS_ENABLED
print("internal check emitted")
#endif
return x + y
}
// CHECKS-LABEL: $s14InternalChecks27test_internal_checks_configyS2i_SitF
// CHECKS: "internal check emitted"
// NOCHECKS-LABEL: $s14InternalChecks27test_internal_checks_configyS2i_SitF
// NOCHECKS-NOT: "internal check emitted"