Karl Schimpf | 5ee234a | 2014-09-12 10:41:40 -0700 | [diff] [blame] | 1 | ; Tests that we name unnamed global addresses. |
| 2 | |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 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 |
Karl Schimpf | e3f64d0 | 2014-10-07 10:38:22 -0700 | [diff] [blame] | 6 | |
| 7 | ; RUN: %l2i --no-local-syms -i %s --insts --args --exit-success \ |
| 8 | ; RUN: -default-function-prefix=h -default-global-prefix=g \ |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 9 | ; RUN: | %ifl FileCheck --check-prefix=BAD %s |
Karl Schimpf | 5ee234a | 2014-09-12 10:41:40 -0700 | [diff] [blame] | 10 | |
Karl Schimpf | e3f64d0 | 2014-10-07 10:38:22 -0700 | [diff] [blame] | 11 | ; RUN: %p2i --no-local-syms -i %s --insts --args --exit-success \ |
Karl Schimpf | 2a5324a | 2014-09-25 09:37:49 -0700 | [diff] [blame] | 12 | ; RUN: -default-function-prefix=h -default-global-prefix=g \ |
| 13 | ; RUN: | FileCheck --check-prefix=BAD %s |
Karl Schimpf | 5ee234a | 2014-09-12 10:41:40 -0700 | [diff] [blame] | 14 | |
Karl Schimpf | 6fcbddd | 2014-11-06 09:49:24 -0800 | [diff] [blame] | 15 | ; RUN: %if --need=allow_disable_ir_gen --command \ |
| 16 | ; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \ |
| 17 | ; RUN: | %if --need=allow_disable_ir_gen --command \ |
| 18 | ; RUN: FileCheck --check-prefix=NOIR %s |
| 19 | |
Karl Schimpf | 5ee234a | 2014-09-12 10:41:40 -0700 | [diff] [blame] | 20 | ; TODO(kschimpf) Check global variable declarations, once generated. |
| 21 | |
| 22 | @0 = internal global [4 x i8] zeroinitializer, align 4 |
| 23 | @1 = internal constant [10 x i8] c"Some stuff", align 1 |
| 24 | @g = internal global [4 x i8] zeroinitializer, align 4 |
| 25 | |
Karl Schimpf | 5ee234a | 2014-09-12 10:41:40 -0700 | [diff] [blame] | 26 | define i32 @2(i32 %v) { |
| 27 | ret i32 %v |
| 28 | } |
| 29 | |
| 30 | ; CHECK: define i32 @Function(i32 %__0) { |
| 31 | ; CHECK-NEXT: __0: |
| 32 | ; CHECK-NEXT: ret i32 %__0 |
| 33 | ; CHECK-NEXT: } |
| 34 | |
| 35 | define void @hg() { |
| 36 | ret void |
| 37 | } |
| 38 | |
Karl Schimpf | 5ee234a | 2014-09-12 10:41:40 -0700 | [diff] [blame] | 39 | |
| 40 | ; CHECK-NEXT: define void @hg() { |
| 41 | ; CHECK-NEXT: __0: |
| 42 | ; CHECK-NEXT: ret void |
| 43 | ; CHECK-NEXT: } |
| 44 | |
| 45 | define void @3() { |
| 46 | ret void |
| 47 | } |
| 48 | |
| 49 | ; CHECK-NEXT: define void @Function1() { |
| 50 | ; CHECK-NEXT: __0: |
| 51 | ; CHECK-NEXT: ret void |
| 52 | ; CHECK-NEXT: } |
Karl Schimpf | e3f64d0 | 2014-10-07 10:38:22 -0700 | [diff] [blame] | 53 | |
| 54 | define void @h5() { |
| 55 | ret void |
| 56 | } |
| 57 | |
| 58 | ; CHECK-NEXT: define void @h5() { |
| 59 | ; CHECK-NEXT: __0: |
| 60 | ; CHECK-NEXT: ret void |
| 61 | ; CHECK-NEXT: } |
| 62 | |
| 63 | ; BAD: Warning : Default global prefix 'g' potentially conflicts with name 'g'. |
| 64 | ; BAD: Warning : Default function prefix 'h' potentially conflicts with name 'h5'. |
Karl Schimpf | 6fcbddd | 2014-11-06 09:49:24 -0800 | [diff] [blame] | 65 | |
| 66 | ; NOIR: Total across all functions |