Home | History | Annotate | Download | only in llvm2ice_tests
      1 ; Test of global variable reordering.
      2 
      3 ; REQUIRES: allow_dump
      4 
      5 ; Test x8632 asm output
      6 ; RUN: %if --need=target_X8632 --command %p2i --filetype=asm --target x8632 \
      7 ; RUN:     -i %s --assemble --disassemble --dis-flags=-rD \
      8 ; RUN:      --args -sz-seed=1 -reorder-global-variables -O2 \
      9 ; RUN:     | %if --need=target_X8632 --command FileCheck %s
     10 ; RUN: %if --need=target_X8632 --command %p2i --filetype=asm --target x8632 \
     11 ; RUN:     -i %s --assemble --disassemble --dis-flags=-rD \
     12 ; RUN:     --args -sz-seed=1 -reorder-global-variables -Om1 \
     13 ; RUN:     | %if --need=target_X8632 --command FileCheck %s
     14 
     15 ; Test x8632 elf output
     16 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --target x8632 \
     17 ; RUN:     -i %s --disassemble --dis-flags=-rD \
     18 ; RUN:     --args -sz-seed=1 -reorder-global-variables -O2 \
     19 ; RUN:     | %if --need=target_X8632 --command FileCheck %s
     20 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --target x8632 \
     21 ; RUN:     -i %s --disassemble --dis-flags=-rD \
     22 ; RUN:     --args -sz-seed=1 -reorder-global-variables -Om1 \
     23 ; RUN:     | %if --need=target_X8632 --command  FileCheck %s
     24 
     25 ; Test arm output
     26 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=obj --target arm32 \
     27 ; RUN:     -i %s --disassemble --dis-flags=-rD \
     28 ; RUN:     --args -sz-seed=1 -reorder-global-variables \
     29 ; RUN:     -O2 \
     30 ; RUN:     | %if --need=target_ARM32 --command FileCheck %s
     31 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=obj --target arm32 \
     32 ; RUN:     -i %s --disassemble --dis-flags=-rD \
     33 ; RUN:     --args -sz-seed=1 -reorder-global-variables \
     34 ; RUN:     -Om1 \
     35 ; RUN:     | %if --need=target_ARM32 --command FileCheck %s
     36 
     37 ; RUN: %if --need=target_MIPS32 --need=allow_dump \
     38 ; RUN:     --command %p2i --filetype=asm --assemble --disassemble --target \
     39 ; RUN:     mips32 -i %s --dis-flags=-rD --args -O2 -sz-seed=1 \
     40 ; RUN:     -reorder-global-variables \
     41 ; RUN:     | %if --need=target_MIPS32 --need=allow_dump --command FileCheck %s
     42 
     43 @PrimitiveInit = internal global [4 x i8] c"\1B\00\00\00", align 4
     44 
     45 @PrimitiveInitConst = internal constant [4 x i8] c"\0D\00\00\00", align 4
     46 
     47 @ArrayInit = internal global [20 x i8] c"\0A\00\00\00\14\00\00\00\1E\00\00\00(\00\00\002\00\00\00", align 4
     48 
     49 @ArrayInitPartial = internal global [40 x i8] c"<\00\00\00F\00\00\00P\00\00\00Z\00\00\00d\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", align 4
     50 
     51 @PrimitiveInitStatic = internal global [4 x i8] zeroinitializer, align 4
     52 
     53 @PrimitiveUninit = internal global [4 x i8] zeroinitializer, align 4
     54 
     55 @ArrayUninit = internal global [20 x i8] zeroinitializer, align 4
     56 
     57 @ArrayUninitConstDouble = internal constant [200 x i8] zeroinitializer, align 8
     58 
     59 @ArrayUninitConstInt = internal constant [20 x i8] zeroinitializer, align 4
     60 
     61 ; Make sure the shuffled order is correct.
     62 
     63 ; CHECK-LABEL: ArrayInit
     64 ; CHECK-LABEL: PrimitiveInit
     65 ; CHECK-LABEL: ArrayInitPartial
     66 ; CHECK-LABEL: PrimitiveUninit
     67 ; CHECK-LABEL: ArrayUninit
     68 ; CHECK-LABEL: PrimitiveInitStatic
     69 ; CHECK-LABEL: ArrayUninitConstDouble
     70 ; CHECK-LABEL: ArrayUninitConstInt
     71 ; CHECK-LABEL: PrimitiveInitConst
     72