File: discard_value_names_gh1749.d

package info (click to toggle)
ldc 1%3A1.30.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 59,248 kB
  • sloc: cpp: 61,598; ansic: 14,545; sh: 1,014; makefile: 972; asm: 510; objc: 135; exp: 48; python: 12
file content (22 lines) | stat: -rw-r--r-- 862 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Test value name discarding when creating non-textual IR.

// RUN: %ldc %S/inputs/input_discard_valuename.d -c -output-ll -of=%t.bar.ll && FileCheck %S/inputs/input_discard_valuename.d < %t.bar.ll

// Output a bitcode file (i.e. with discarded names) and input it into a second LDC command that outputs textual IR.
// RUN: %ldc %S/inputs/input_discard_valuename.d -g -c -output-bc -of=%t.bar.bc \
// RUN: && %ldc %s %t.bar.bc -g -c -output-ll -of=%t.ll && FileCheck %s < %t.ll

// IR imported from the bitcode file should not have local value names:
// CHECK-LABEL: define{{.*}} @foo
// CHECK: %localfoovar
// CHECK-LABEL: define{{.*}} @bar
// CHECK-NOT: %localbarvar

// But the imported IR should still have debug names:
// CHECK: DILocalVariable{{.*}}"localfoovar"
// CHECK: DILocalVariable{{.*}}"localbarvar"

extern(C) void foo()
{
    int localfoovar;
}