1 ; RUN: opt -mtriple i686-win32 -rewrite-symbols -rewrite-map-file %p/rewrite.map \ 2 ; RUN: %s -o - | llvm-dis | FileCheck %s 3 4 declare void @source_function() 5 @source_variable = external global i32 6 declare void @source_function_pattern_function() 7 declare void @source_function_pattern_multiple_function_matches() 8 @source_variable_pattern_variable = external global i32 9 @source_variable_pattern_multiple_variable_matches = external global i32 10 declare void @"\01naked_source_function"() 11 declare void @"\01__imp_missing_global_leader_prefix"() 12 13 declare i32 @first_callee() 14 declare i32 @second_callee() 15 define i32 @caller() { 16 %rhs = call i32 @first_callee() 17 %lhs = call i32 @second_callee() 18 %res = add i32 %rhs, %lhs 19 ret i32 %res 20 } 21 22 %struct.S = type { i8 } 23 @_ZN1SC1Ev = alias void (%struct.S*), void (%struct.S*)* @_ZN1SC2Ev 24 define void @_ZN1SC2Ev(%struct.S* %this) unnamed_addr align 2 { 25 entry: 26 %this.addr = alloca %struct.S*, align 4 27 store %struct.S* %this, %struct.S** %this.addr, align 4 28 ret void 29 } 30 31 $source_comdat_function = comdat any 32 define dllexport void @source_comdat_function() comdat($source_comdat_function) { 33 entry: 34 ret void 35 } 36 37 $source_comdat_function_1 = comdat exactmatch 38 define dllexport void @source_comdat_function_1() comdat($source_comdat_function_1) { 39 entry: 40 ret void 41 } 42 43 $source_comdat_variable = comdat largest 44 @source_comdat_variable = global i32 32, comdat($source_comdat_variable) 45 46 $source_comdat_variable_1 = comdat noduplicates 47 @source_comdat_variable_1 = global i32 64, comdat($source_comdat_variable_1) 48 49 ; CHECK: $target_comdat_function = comdat any 50 ; CHECK: $target_comdat_function_1 = comdat exactmatch 51 ; CHECK: $target_comdat_variable = comdat largest 52 ; CHECK: $target_comdat_variable_1 = comdat noduplicates 53 54 ; CHECK: @target_variable = external global i32 55 ; CHECK-NOT: @source_variable = external global i32 56 ; CHECK: @target_pattern_variable = external global i32 57 ; CHECK-NOT: @source_pattern_variable = external global i32 58 ; CHECK: @target_pattern_multiple_variable_matches = external global i32 59 ; CHECK-NOT: @source_pattern_multiple_variable_matches = external global i32 60 ; CHECK: @target_comdat_variable = global i32 32, comdat 61 ; CHECK-NOT: @source_comdat_variable = global i32 32, comdat 62 ; CHECK: @target_comdat_variable_1 = global i32 64, comdat 63 ; CHECK-NOT: @source_comdat_variable_1 = global i32 64, comdat 64 65 ; CHECK: declare void @target_function() 66 ; CHECK-NOT: declare void @source_function() 67 ; CHECK: declare void @target_pattern_function() 68 ; CHECK-NOT: declare void @source_function_pattern_function() 69 ; CHECK: declare void @target_pattern_multiple_function_matches() 70 ; CHECK-NOT: declare void @source_function_pattern_multiple_function_matches() 71 ; CHECK: declare void @naked_target_function() 72 ; CHECK-NOT: declare void @"\01naked_source_function"() 73 ; CHECK-NOT: declare void @"\01__imp__imported_function"() 74 ; CHECK: declare void @"\01__imp_missing_global_leader_prefix"() 75 ; CHECK-NOT: declare void @"\01__imp_DO_NOT_REWRITE"() 76 77 ; CHECK: declare i32 @renamed_callee() 78 ; CHECK-NOT: declare i32 @first_callee() 79 ; CHECK: declare i32 @second_callee() 80 ; CHECK: define i32 @caller() { 81 ; CHECK: %rhs = call i32 @renamed_callee() 82 ; CHECK-NOT: %rhs = call i32 @first_callee() 83 ; CHECK: %lhs = call i32 @second_callee() 84 ; CHECK: %res = add i32 %rhs, %lhs 85 ; CHECK: ret i32 %res 86 ; CHECK: } 87 88 ; CHECK: define dllexport void @target_comdat_function() comdat 89 ; CHECK-NOT: define dllexport void @source_comdat_function() comdat 90 ; CHECK: define dllexport void @target_comdat_function_1() comdat 91 ; CHECK-NOT: define dllexport void @source_comdat_function_1() comdat 92 93