1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -O0 -fast-isel -mattr=+vsx -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64VSX 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker;; The semantics of VSX stores for when R0 is used is different depending on 4*9880d681SAndroid Build Coastguard Worker;; whether it is used as base or offset. If used as base, the effective 5*9880d681SAndroid Build Coastguard Worker;; address computation will use zero regardless of the content of R0. If used as 6*9880d681SAndroid Build Coastguard Worker;; an offset the content will be used in the effective address. We observed that 7*9880d681SAndroid Build Coastguard Worker;; for some constructors, the initialization values were being stored without 8*9880d681SAndroid Build Coastguard Worker;; an offset register being specified which was causing R0 to be used as offset 9*9880d681SAndroid Build Coastguard Worker;; in regions where it contained the value in the link register. This test 10*9880d681SAndroid Build Coastguard Worker;; verifies that R0 is used as base in these situations. 11*9880d681SAndroid Build Coastguard Worker 12*9880d681SAndroid Build Coastguard Worker%SomeStruct = type { double } 13*9880d681SAndroid Build Coastguard Worker 14*9880d681SAndroid Build Coastguard Worker; ELF64VSX-LABEL: SomeStructCtor 15*9880d681SAndroid Build Coastguard Workerdefine linkonce_odr void @SomeStructCtor(%SomeStruct* %this, double %V) unnamed_addr align 2 { 16*9880d681SAndroid Build Coastguard Workerentry: 17*9880d681SAndroid Build Coastguard Worker %this.addr = alloca %SomeStruct*, align 8 18*9880d681SAndroid Build Coastguard Worker %V.addr = alloca double, align 8 19*9880d681SAndroid Build Coastguard Worker store %SomeStruct* %this, %SomeStruct** %this.addr, align 8 20*9880d681SAndroid Build Coastguard Worker; ELF64VSX: stxsdx {{[0-9][0-9]?}}, 0, {{[1-9][0-9]?}} 21*9880d681SAndroid Build Coastguard Worker store double %V, double* %V.addr, align 8 22*9880d681SAndroid Build Coastguard Worker %this1 = load %SomeStruct*, %SomeStruct** %this.addr 23*9880d681SAndroid Build Coastguard Worker %Val = getelementptr inbounds %SomeStruct, %SomeStruct* %this1, i32 0, i32 0 24*9880d681SAndroid Build Coastguard Worker; ELF64VSX: stxsdx {{[0-9][0-9]?}}, 0, {{[1-9][0-9]?}} 25*9880d681SAndroid Build Coastguard Worker %0 = load double, double* %V.addr, align 8 26*9880d681SAndroid Build Coastguard Worker store double %0, double* %Val, align 8 27*9880d681SAndroid Build Coastguard Worker ret void 28*9880d681SAndroid Build Coastguard Worker } 29