brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 6e088ef Raw
59 lines · plain
1; RUN: opt -passes=metarenamer -rename-exclude-function-prefixes=my_func -rename-exclude-global-prefixes=my_global -rename-exclude-struct-prefixes=my_struct -rename-exclude-alias-prefixes=my_alias -S %s | FileCheck %s2 3; Check that excluded names don't get renamed while all the other ones do4 5; CHECK: %my_struct1 = type { ptr, i32 }6; CHECK: %my_struct2 = type { ptr, i32 }7; CHECK-NOT: %other_struct = type { ptr, i32 }8; CHECK: @my_global1 = global i32 429; CHECK: @my_global2 = global i32 2410; CHECK-NOT: @other_global = global i32 2411; CHECK: @my_alias1 = alias i32, ptr @my_global112; CHECK: @my_alias2 = alias i32, ptr @my_global213; CHECK-NOT: @other_alias = alias i32, ptr @other_global14; CHECK: declare void @my_func115; CHECK: declare void @my_func216; CHECK-NOT: declare void @other_func17 18; CHECK: call void @my_func119; CHECK: call void @my_func220; CHECK-NOT: call void @other_func21; CHECK: load i32, ptr @my_global122; CHECK: load i32, ptr @my_global223; CHECK-NOT: load i32, ptr @other_global24; CHECK: load i32, ptr @my_alias125; CHECK: load i32, ptr @my_alias226; CHECK-NOT: load i32, ptr @other_alias27; CHECK: alloca %my_struct128; CHECK: alloca %my_struct229; CHECK-NOT: alloca %other_struct30 31%my_struct1 = type { ptr, i32 }32%my_struct2 = type { ptr, i32 }33%other_struct = type { ptr, i32 }34@my_global1 = global i32 4235@my_global2 = global i32 2436@other_global = global i32 2437@my_alias1 = alias i32, ptr @my_global138@my_alias2 = alias i32, ptr @my_global239@other_alias = alias i32, ptr @other_global40declare void @my_func1()41declare void @my_func2()42declare void @other_func()43 44define void @some_func() {45  call void @my_func1()46  call void @my_func2()47  call void @other_func()48  %a = load i32, ptr @my_global149  %b = load i32, ptr @my_global250  %c = load i32, ptr @other_global51  %d = load i32, ptr @my_alias152  %e = load i32, ptr @my_alias253  %f = load i32, ptr @other_alias54  %g = alloca %my_struct155  %h = alloca %my_struct256  %i = alloca %other_struct57  ret void58}59