File: conditional-dead-strip-objc-ir.swift

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (30 lines) | stat: -rw-r--r-- 1,188 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Tests that with -conditional-runtime-records, IRGen marks class, struct,
// enum, protocol, and protocol conformance records as conditionally removable
// via !llvm.used.conditional metadata.

// REQUIRES: objc_interop

// RUN: %target-build-swift -Xfrontend -conditional-runtime-records %s -emit-ir -o - | %FileCheck %s

import Foundation

public class Class {
}

@objc public protocol ObjCAnnotatedProtocol {
}

// CHECK:      @llvm.{{(compiler.)?}}used = appending global [
// CHECK-SAME:   @"$s4main5ClassCHn"
// CHECK-SAME: ], section "llvm.metadata"

// CHECK:      !llvm.used.conditional = !{[[M1:!.*]], [[M2:!.*]], [[M3:!.*]], [[O1:!.*]]}

// CHECK-DAG:      [[M1]]  = !{{{.*}} @"$s4main5ClassCMF", i32 0, [[M1A:!.*]]}
// CHECK-DAG:      [[M1A]] = !{{{.*}} @"$s4main5ClassCMn"
// CHECK-DAG:      [[M2]]  = !{{{.*}} @"$s4main21ObjCAnnotatedProtocol_pMF", i32 0, [[M2A:!.*]]}
// CHECK-DAG:      [[M2A]] = !{{{.*}} @"$s4main21ObjCAnnotatedProtocolMp"
// CHECK-DAG:      [[M3]]  = !{{{.*}} @"$s4main5ClassCHn", i32 0, [[M1A:!.*]]}

// CHECK-DAG:      [[O1]]  = !{{{.*}} @"objc_classes_$s4main5ClassCN", i32 0, [[O1A:!.*]]}
// CHECK-DAG:      [[O1A]] = !{{{.*}} @"$s4main5ClassCN"}