File: opt-record-bitstream.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 (36 lines) | stat: -rw-r--r-- 1,496 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
31
32
33
34
35
36
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -c -O -wmo -save-optimization-record=bitstream -save-optimization-record-path %t/optrecordmod.opt.bitstream %s -module-name optrecordmod -o %t/opt-record.o 2>&1 | %FileCheck -allow-empty %s
// RUN: llvm-bcanalyzer -dump %t/optrecordmod.opt.bitstream | %FileCheck -check-prefix=BITSTREAM %s
// RUN: otool -l %t/opt-record.o | %FileCheck -check-prefix=OBJ %s

// REQUIRES: VENDOR=apple

// Ensure we emitted the appropriate section

// OBJ: sectname __remarks

// CHECK-NOT: remark

var a: Int = 1

#sourceLocation(file: "custom.swift", line: 2000)
func foo() {
  a = 2
}
#sourceLocation() // reset

public func bar() {
  foo()
  // BITSTREAM: <Remark NumWords=13 BlockCodeSize=4>
  // BITSTREAM-NEXT:   <Remark header abbrevid=4 op0=1 op1=0 op2=1 op3=2/>
  // BITSTREAM-NEXT:   <Remark debug location abbrevid=5 op0=3 op1=[[@LINE-3]] op2=3/>
  // BITSTREAM-NEXT:   <Argument with debug location abbrevid=7 op0=4 op1=5 op2=6 op3=2000 op4=6/>
  // BITSTREAM-NEXT:   <Argument abbrevid=8 op0=7 op1=8/>
  // BITSTREAM-NEXT:   <Argument with debug location abbrevid=7 op0=9 op1=10 op2=3 op3=[[@LINE-7]] op4=13/>
  // BITSTREAM-NEXT:   <Argument abbrevid=8 op0=7 op1=11/>
  // BITSTREAM-NEXT:   <Argument abbrevid=8 op0=12 op1=13/>
  // BITSTREAM-NEXT:   <Argument abbrevid=8 op0=7 op1=14/>
  // BITSTREAM-NEXT:   <Argument abbrevid=8 op0=15 op1=16/>
  // BITSTREAM-NEXT:   <Argument abbrevid=8 op0=7 op1=17/>
  // BITSTREAM-NEXT: </Remark>
}