• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Tests that we name unnamed global addresses.
2
3; Check that Subzero's bitcode reader handles renaming correctly.
4; RUN: %p2i --no-local-syms -i %s --insts | FileCheck %s
5; RUN: %l2i --no-local-syms -i %s --insts | %ifl FileCheck %s
6
7; RUN: %l2i --no-local-syms -i %s --insts --args --exit-success \
8; RUN:      -default-function-prefix=h -default-global-prefix=g \
9; RUN:      | %ifl FileCheck --check-prefix=BAD %s
10
11; RUN: %p2i --no-local-syms -i %s --insts --args --exit-success \
12; RUN:      -default-function-prefix=h -default-global-prefix=g \
13; RUN:      | FileCheck --check-prefix=BAD %s
14
15; RUN:   %p2i -i %s --args -notranslate -timing | \
16; RUN:   FileCheck --check-prefix=NOIR %s
17
18; TODO(kschimpf) Check global variable declarations, once generated.
19
20@0 = internal global [4 x i8] zeroinitializer, align 4
21@1 = internal constant [10 x i8] c"Some stuff", align 1
22@g = internal global [4 x i8] zeroinitializer, align 4
23
24define internal i32 @2(i32 %v) {
25  ret i32 %v
26}
27
28; CHECK:      define internal i32 @Function(i32 %__0) {
29; CHECK-NEXT: __0:
30; CHECK-NEXT:   ret i32 %__0
31; CHECK-NEXT: }
32
33define internal void @hg() {
34  ret void
35}
36
37
38; CHECK-NEXT: define internal void @hg() {
39; CHECK-NEXT: __0:
40; CHECK-NEXT:   ret void
41; CHECK-NEXT: }
42
43define internal void @3() {
44  ret void
45}
46
47; CHECK-NEXT: define internal void @Function1() {
48; CHECK-NEXT: __0:
49; CHECK-NEXT:   ret void
50; CHECK-NEXT: }
51
52define internal void @h5() {
53  ret void
54}
55
56; CHECK-NEXT: define internal void @h5() {
57; CHECK-NEXT: __0:
58; CHECK-NEXT:   ret void
59; CHECK-NEXT: }
60
61; BAD: Warning : Default global prefix 'g' potentially conflicts with name 'g'.
62; BAD: Warning : Default function prefix 'h' potentially conflicts with name 'h5'.
63
64; NOIR: Total across all functions
65