1 ; RUN: opt -metarenamer -S < %s | FileCheck %s
2 ; RUN: opt -passes=metarenamer -S < %s | FileCheck %s
4 ; CHECK: target triple {{.*}}
5 ; CHECK-NOT: {{^x*}}xxx{{^x*}}
8 target triple = "x86_64-pc-linux-gnu"
10 %struct.bar_xxx = type { i32, double }
11 %struct.foo_xxx = type { i32, float, %struct.bar_xxx }
13 @func_5_xxx.static_local_3_xxx = internal global i32 3, align 4
14 @global_3_xxx = common global i32 0, align 4
16 @func_7_xxx = weak alias i32 (...), i32 (...)* @aliased_func_7_xxx
18 define i32 @aliased_func_7_xxx(...) {
22 define i32 @func_3_xxx() nounwind uwtable ssp {
26 define void @func_4_xxx(%struct.foo_xxx* sret(%struct.foo_xxx) %agg.result) nounwind uwtable ssp {
27 %1 = alloca %struct.foo_xxx, align 8
28 %2 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 0
29 store i32 1, i32* %2, align 4
30 %3 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 1
31 store float 2.000000e+00, float* %3, align 4
32 %4 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 2
33 %5 = getelementptr inbounds %struct.bar_xxx, %struct.bar_xxx* %4, i32 0, i32 0
34 store i32 3, i32* %5, align 4
35 %6 = getelementptr inbounds %struct.bar_xxx, %struct.bar_xxx* %4, i32 0, i32 1
36 store double 4.000000e+00, double* %6, align 8
37 %7 = bitcast %struct.foo_xxx* %agg.result to i8*
38 %8 = bitcast %struct.foo_xxx* %1 to i8*
39 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %7, i8* align 8 %8, i64 24, i1 false)
43 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
45 define i32 @func_5_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, i32 %arg_3_xxx, i32 %arg_4_xxx) nounwind uwtable ssp {
46 %1 = alloca i32, align 4
47 %2 = alloca i32, align 4
48 %3 = alloca i32, align 4
49 %4 = alloca i32, align 4
50 %local_1_xxx = alloca i32, align 4
51 %local_2_xxx = alloca i32, align 4
52 %i = alloca i32, align 4
53 store i32 %arg_1_xxx, i32* %1, align 4
54 store i32 %arg_2_xxx, i32* %2, align 4
55 store i32 %arg_3_xxx, i32* %3, align 4
56 store i32 %arg_4_xxx, i32* %4, align 4
57 store i32 1, i32* %local_1_xxx, align 4
58 store i32 2, i32* %local_2_xxx, align 4
59 store i32 0, i32* %i, align 4
62 ; <label>:5 ; preds = %9, %0
63 %6 = load i32, i32* %i, align 4
64 %7 = icmp slt i32 %6, 10
65 br i1 %7, label %8, label %12
67 ; <label>:8 ; preds = %5
70 ; <label>:9 ; preds = %8
71 %10 = load i32, i32* %i, align 4
72 %11 = add nsw i32 %10, 1
73 store i32 %11, i32* %i, align 4
76 ; <label>:12 ; preds = %5
77 %13 = load i32, i32* %local_1_xxx, align 4
78 %14 = load i32, i32* %1, align 4
79 %15 = add nsw i32 %13, %14
80 %16 = load i32, i32* %local_2_xxx, align 4
81 %17 = add nsw i32 %15, %16
82 %18 = load i32, i32* %2, align 4
83 %19 = add nsw i32 %17, %18
84 %20 = load i32, i32* @func_5_xxx.static_local_3_xxx, align 4
85 %21 = add nsw i32 %19, %20
86 %22 = load i32, i32* %3, align 4
87 %23 = add nsw i32 %21, %22
88 %24 = load i32, i32* %4, align 4
89 %25 = add nsw i32 %23, %24
93 define i32 @varargs_func_6_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, ...) nounwind uwtable ssp {
94 %1 = alloca i32, align 4
95 %2 = alloca i32, align 4
96 store i32 %arg_1_xxx, i32* %1, align 4
97 store i32 %arg_2_xxx, i32* %2, align 4
101 declare noalias i8* @malloc(i32)
102 declare void @free(i8* nocapture)
104 define void @dont_rename_lib_funcs() {
107 ; CHECK-NEXT: [[TMP:%.*]] = call i8* @malloc(i32 23)
108 ; CHECK-NEXT: call void @free(i8* [[TMP]])
109 ; CHECK-NEXT: ret void
111 %x = call i8* @malloc(i32 23)
112 call void @free(i8* %x)