File: opt-record-bitstream.swift

package info (click to toggle)
swiftlang 6.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,532 kB
  • sloc: cpp: 9,901,743; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (36 lines) | stat: -rw-r--r-- 1,496 bytes parent folder | download | duplicates (2)
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>
}