Files
swift-mirror/test/SILOptimizer/mandatory_nil_comparison_inlining.swift
Erik Eckstein 1d3724666f tests: convert about 400 tests to the new mangling by using the -new-mangling-for-tests option
When the new mangling is enabled permanently, the option can be removed from the RUN command lines again.
2017-01-24 15:27:45 -08:00

39 lines
927 B
Swift

// RUN: %target-swift-frontend -primary-file %s -module-name=test -emit-sil -o - -verify | %FileCheck %s
// CHECK-LABEL: sil {{.*}} @{{.*}}generic_func
// CHECK: switch_enum_addr
// CHECK: return
func generic_func<T>(x: [T]?) -> Bool {
return x == nil
}
// CHECK-LABEL: sil {{.*}} @{{.*}}array_func_rhs_nil
// CHECK: switch_enum_addr
// CHECK: return
func array_func_rhs_nil(x: [Int]?) -> Bool {
return x == nil
}
// CHECK-LABEL: sil {{.*}} @{{.*}}array_func_lhs_nil
// CHECK: switch_enum_addr
// CHECK: return
func array_func_lhs_nil(x: [Int]?) -> Bool {
return nil == x
}
// CHECK-LABEL: sil {{.*}} @{{.*}}array_func_rhs_non_nil
// CHECK: switch_enum_addr
// CHECK: return
func array_func_rhs_non_nil(x: [Int]?) -> Bool {
return x != nil
}
// CHECK-LABEL: sil {{.*}} @{{.*}}array_func_lhs_non_nil
// CHECK: switch_enum_addr
// CHECK: return
func array_func_lhs_non_nil(x: [Int]?) -> Bool {
return nil != x
}