Sandeep Patel | 452b54a | 2009-10-15 22:25:32 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=thumbv7-eabi -mcpu=cortex-a8 -float-abi=hard | FileCheck %s |
Dan Gohman | 30fc5bb | 2010-05-03 14:35:47 +0000 | [diff] [blame] | 2 | ; PR5204 |
Sandeep Patel | 452b54a | 2009-10-15 22:25:32 +0000 | [diff] [blame] | 3 | |
| 4 | %"struct.__gnu_cxx::__normal_iterator<char*,std::basic_string<char, std::char_traits<char>, std::allocator<char> > >" = type { i8* } |
| 5 | %"struct.__gnu_cxx::new_allocator<char>" = type <{ i8 }> |
| 6 | %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >" = type { %"struct.__gnu_cxx::__normal_iterator<char*,std::basic_string<char, std::char_traits<char>, std::allocator<char> > >" } |
| 7 | %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep_base" } |
| 8 | %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep_base" = type { i32, i32, i32 } |
| 9 | |
| 10 | |
| 11 | define weak arm_aapcs_vfpcc i32 @_ZNKSs7compareERKSs(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %this, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %__str) { |
| 12 | ; CHECK: _ZNKSs7compareERKSs: |
Dan Gohman | 30fc5bb | 2010-05-03 14:35:47 +0000 | [diff] [blame] | 13 | ; CHECK: it eq |
| 14 | ; CHECK-NEXT: subeq.w r0, r6, r8 |
| 15 | ; CHECK-NEXT: ldmia.w sp, {r4, r5, r6, r8, r9, pc} |
Sandeep Patel | 452b54a | 2009-10-15 22:25:32 +0000 | [diff] [blame] | 16 | entry: |
| 17 | %0 = tail call arm_aapcs_vfpcc i32 @_ZNKSs4sizeEv(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %this) ; <i32> [#uses=3] |
| 18 | %1 = tail call arm_aapcs_vfpcc i32 @_ZNKSs4sizeEv(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %__str) ; <i32> [#uses=3] |
| 19 | %2 = icmp ult i32 %1, %0 ; <i1> [#uses=1] |
| 20 | %3 = select i1 %2, i32 %1, i32 %0 ; <i32> [#uses=1] |
| 21 | %4 = tail call arm_aapcs_vfpcc i8* @_ZNKSs7_M_dataEv(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %this) ; <i8*> [#uses=1] |
| 22 | %5 = tail call arm_aapcs_vfpcc i8* @_ZNKSs4dataEv(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %__str) ; <i8*> [#uses=1] |
| 23 | %6 = tail call arm_aapcs_vfpcc i32 @memcmp(i8* %4, i8* %5, i32 %3) nounwind readonly ; <i32> [#uses=2] |
| 24 | %7 = icmp eq i32 %6, 0 ; <i1> [#uses=1] |
| 25 | br i1 %7, label %bb, label %bb1 |
| 26 | |
| 27 | bb: ; preds = %entry |
| 28 | %8 = sub i32 %0, %1 ; <i32> [#uses=1] |
| 29 | ret i32 %8 |
| 30 | |
| 31 | bb1: ; preds = %entry |
| 32 | ret i32 %6 |
| 33 | } |
| 34 | |
| 35 | declare arm_aapcs_vfpcc i32 @memcmp(i8* nocapture, i8* nocapture, i32) nounwind readonly |
| 36 | |
| 37 | declare arm_aapcs_vfpcc i32 @_ZNKSs4sizeEv(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %this) |
| 38 | |
| 39 | declare arm_aapcs_vfpcc i8* @_ZNKSs7_M_dataEv(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %this) |
| 40 | |
| 41 | declare arm_aapcs_vfpcc i8* @_ZNKSs4dataEv(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %this) |