Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py =================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py @@ -171,17 +171,45 @@ #self.return_and_test_struct_value ("return_one_int_one_double_packed") self.return_and_test_struct_value("return_one_int_one_long") - # icc and gcc don't support this extension. - if self.getCompiler().endswith('clang'): - self.return_and_test_struct_value("return_vector_size_float32_8") - self.return_and_test_struct_value("return_vector_size_float32_16") - self.return_and_test_struct_value("return_vector_size_float32_32") - self.return_and_test_struct_value( - "return_ext_vector_size_float32_2") - self.return_and_test_struct_value( - "return_ext_vector_size_float32_4") - self.return_and_test_struct_value( - "return_ext_vector_size_float32_8") + @expectedFailureAll(oslist=["freebsd"], archs=["i386"]) + @expectedFailureAll(oslist=["macosx"], archs=["i386"], bugnumber="") + @expectedFailureAll( + oslist=["linux"], + compiler="clang", + compiler_version=[ + "<=", + "3.6"], + archs=["i386"]) + @expectedFailureAll( + bugnumber="llvm.org/pr25785", + hostoslist=["windows"], + compiler="gcc", + archs=["i386"], + triple='.*-android') + @expectedFailureAll(compiler=["gcc"], archs=["x86_64", "i386"]) + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778") + def test_vector_values(self): + self.build() + exe = os.path.join(os.getcwd(), "a.out") + error = lldb.SBError() + + self.target = self.dbg.CreateTarget(exe) + self.assertTrue(self.target, VALID_TARGET) + + main_bktp = self.target.BreakpointCreateByName("main", exe) + self.assertTrue(main_bktp, VALID_BREAKPOINT) + + self.process = self.target.LaunchSimple( + None, None, self.get_process_working_directory()) + self.assertEqual(len(lldbutil.get_threads_stopped_at_breakpoint( + self.process, main_bktp)), 1) + + self.return_and_test_struct_value("return_vector_size_float32_8") + self.return_and_test_struct_value("return_vector_size_float32_16") + self.return_and_test_struct_value("return_vector_size_float32_32") + self.return_and_test_struct_value("return_ext_vector_size_float32_2") + self.return_and_test_struct_value("return_ext_vector_size_float32_4") + self.return_and_test_struct_value("return_ext_vector_size_float32_8") def return_and_test_struct_value(self, func_name): """Pass in the name of the function to return from - takes in value, returns value.""" Index: lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp +++ lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp @@ -2362,32 +2362,30 @@ if (success) return_valobj_sp = ValueObjectConstResult::Create( thread.GetStackFrameAtIndex(0).get(), value, ConstString("")); - } else if (type_flags & eTypeIsVector) { + } else if (type_flags & eTypeIsVector && byte_size <= 16) { if (byte_size > 0) { const RegisterInfo *v0_info = reg_ctx->GetRegisterInfoByName("v0", 0); if (v0_info) { - if (byte_size <= v0_info->byte_size) { - std::unique_ptr heap_data_ap( - new DataBufferHeap(byte_size, 0)); - const ByteOrder byte_order = exe_ctx.GetProcessRef().GetByteOrder(); - RegisterValue reg_value; - if (reg_ctx->ReadRegister(v0_info, reg_value)) { - Error error; - if (reg_value.GetAsMemoryData(v0_info, heap_data_ap->GetBytes(), - heap_data_ap->GetByteSize(), - byte_order, error)) { - DataExtractor data(DataBufferSP(heap_data_ap.release()), - byte_order, - exe_ctx.GetProcessRef().GetAddressByteSize()); - return_valobj_sp = ValueObjectConstResult::Create( - &thread, return_compiler_type, ConstString(""), data); - } + std::unique_ptr heap_data_ap( + new DataBufferHeap(byte_size, 0)); + const ByteOrder byte_order = exe_ctx.GetProcessRef().GetByteOrder(); + RegisterValue reg_value; + if (reg_ctx->ReadRegister(v0_info, reg_value)) { + Error error; + if (reg_value.GetAsMemoryData(v0_info, heap_data_ap->GetBytes(), + heap_data_ap->GetByteSize(), byte_order, + error)) { + DataExtractor data(DataBufferSP(heap_data_ap.release()), byte_order, + exe_ctx.GetProcessRef().GetAddressByteSize()); + return_valobj_sp = ValueObjectConstResult::Create( + &thread, return_compiler_type, ConstString(""), data); } } } } - } else if (type_flags & eTypeIsStructUnion || type_flags & eTypeIsClass) { + } else if (type_flags & eTypeIsStructUnion || type_flags & eTypeIsClass || + (type_flags & eTypeIsVector && byte_size > 16)) { DataExtractor data; uint32_t NGRN = 0; // Search ABI docs for NGRN