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