mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The asmname attribute allows one to specify the name that will be used when lowering a given SIL declaration to LLVM IR. It is not currently exposed in the surface language. Make sure this attribute round-trips through the parser and serialization. Part of rdar://137014448O.
17 lines
740 B
Plaintext
17 lines
740 B
Plaintext
// First parse this and then emit a *.sib. Then read in the *.sib, then recreate
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %target-sil-opt -sil-print-types %s -emit-sib -o %t/tmp.sib -module-name borrow
|
|
// RUN: %target-sil-opt -sil-print-types %t/tmp.sib -o %t/tmp.2.sib -module-name borrow
|
|
// RUN: %target-sil-opt -sil-print-types %t/tmp.2.sib -module-name asmname -emit-sorted-sil | %FileCheck %s
|
|
|
|
import Swift
|
|
|
|
// CHECK: sil_global [asmname "v1"] @$s4main13renamedGlobalSivp : $Int
|
|
sil_global [asmname "v1"] @$s4main13renamedGlobalSivp : $Int
|
|
|
|
// CHECK: sil [asmname "f1"] @$s4main15renamedFunctionyyF : $@convention(thin) () -> ()
|
|
sil [asmname "f1"] @$s4main15renamedFunctionyyF : $@convention(thin) () -> () {
|
|
%0 = tuple ()
|
|
return %0
|
|
}
|