Files
swift-mirror/test/SILOptimizer/no-external-defs-onone.sil
Ben Barham c163e0fe5e [Tests] Make OS features consistent
lit.py currently allows any substring of `target_triple` to be used as a
feature in REQUIRES/UNSUPPORTED/XFAIL. This results in various forms of
the OS spread across the tests and is also somewhat confusing since they
aren't actually listed in the available features.

Modify all OS-related features to use the `OS=` version that Swift adds
instead. We can later remove `config.target_triple` so that these don't
the non-OS versions don't work in the first place.
2022-05-20 19:51:23 -07:00

42 lines
1.4 KiB
Plaintext

// RUN: %target-swift-frontend -module-name=test -Onone -emit-ir %s | %FileCheck %s
// CHECK-DAG: define linkonce_odr hidden swiftcc void @shared_external_test()
// CHECK-DAG: declare {{(dllimport )?}}swiftcc void @public_external_test()
// Non-public external symbols are emitted into clients.
// CHECK-DAG: declare swiftcc void @hidden_external_test()
// CHECK-NOT: public_external_unused_test
// TODO: update check line for the hidden_external_test for Windows.
// UNSUPPORTED: OS=windows-msvc
sil public_external [serialized] @public_external_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil hidden_external @hidden_external_test : $@convention(thin) () -> ()
sil shared @shared_external_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil public_external [serialized] @public_external_unused_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil public @use_all_symbols : $@convention(thin) () -> () {
%0 = function_ref @public_external_test : $@convention(thin) () -> ()
%1 = function_ref @hidden_external_test : $@convention(thin) () -> ()
%2 = function_ref @shared_external_test : $@convention(thin) () -> ()
apply %0() : $@convention(thin) () -> ()
apply %1() : $@convention(thin) () -> ()
apply %2() : $@convention(thin) () -> ()
%24 = tuple()
return %24 : $()
}