1 ; RUN: opt -passes=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 (...), ptr @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(ptr sret(%struct.foo_xxx) %agg.result) nounwind uwtable ssp {
26 %1 = alloca %struct.foo_xxx, align 8
27 store i32 1, ptr %1, align 4
28 %2 = getelementptr inbounds %struct.foo_xxx, ptr %1, i32 0, i32 1
29 store float 2.000000e+00, ptr %2, align 4
30 %3 = getelementptr inbounds %struct.foo_xxx, ptr %1, i32 0, i32 2
31 store i32 3, ptr %3, align 4
32 %4 = getelementptr inbounds %struct.bar_xxx, ptr %3, i32 0, i32 1
33 store double 4.000000e+00, ptr %4, align 8
34 call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.result, ptr align 8 %1, i64 24, i1 false)
38 declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind
40 define i32 @func_5_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, i32 %arg_3_xxx, i32 %arg_4_xxx) nounwind uwtable ssp {
41 %1 = alloca i32, align 4
42 %2 = alloca i32, align 4
43 %3 = alloca i32, align 4
44 %4 = alloca i32, align 4
45 %local_1_xxx = alloca i32, align 4
46 %local_2_xxx = alloca i32, align 4
47 %i = alloca i32, align 4
48 store i32 %arg_1_xxx, ptr %1, align 4
49 store i32 %arg_2_xxx, ptr %2, align 4
50 store i32 %arg_3_xxx, ptr %3, align 4
51 store i32 %arg_4_xxx, ptr %4, align 4
52 store i32 1, ptr %local_1_xxx, align 4
53 store i32 2, ptr %local_2_xxx, align 4
54 store i32 0, ptr %i, align 4
57 ; <label>:5 ; preds = %9, %0
58 %6 = load i32, ptr %i, align 4
59 %7 = icmp slt i32 %6, 10
60 br i1 %7, label %8, label %12
62 ; <label>:8 ; preds = %5
65 ; <label>:9 ; preds = %8
66 %10 = load i32, ptr %i, align 4
67 %11 = add nsw i32 %10, 1
68 store i32 %11, ptr %i, align 4
71 ; <label>:12 ; preds = %5
72 %13 = load i32, ptr %local_1_xxx, align 4
73 %14 = load i32, ptr %1, align 4
74 %15 = add nsw i32 %13, %14
75 %16 = load i32, ptr %local_2_xxx, align 4
76 %17 = add nsw i32 %15, %16
77 %18 = load i32, ptr %2, align 4
78 %19 = add nsw i32 %17, %18
79 %20 = load i32, ptr @func_5_xxx.static_local_3_xxx, align 4
80 %21 = add nsw i32 %19, %20
81 %22 = load i32, ptr %3, align 4
82 %23 = add nsw i32 %21, %22
83 %24 = load i32, ptr %4, align 4
84 %25 = add nsw i32 %23, %24
88 define i32 @varargs_func_6_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, ...) nounwind uwtable ssp {
89 %1 = alloca i32, align 4
90 %2 = alloca i32, align 4
91 store i32 %arg_1_xxx, ptr %1, align 4
92 store i32 %arg_2_xxx, ptr %2, align 4
96 declare noalias ptr @malloc(i64)
97 declare void @free(ptr nocapture)
99 define void @dont_rename_lib_funcs() {
102 ; CHECK-NEXT: [[TMP:%.*]] = call ptr @malloc(i64 23)
103 ; CHECK-NEXT: call void @free(ptr [[TMP]])
104 ; CHECK-NEXT: ret void
106 %x = call ptr @malloc(i64 23)
107 call void @free(ptr %x)