1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ;; Check the cases involving dso_local_equivalent where we do not expect functions to be merged.
3 ; RUN: opt -S -passes=mergefunc < %s | FileCheck %s
5 @x = constant { ptr, ptr } { ptr @a, ptr @b }
6 ; CHECK: { ptr @a, ptr @b }
8 @x2 = constant { ptr, ptr } { ptr @c, ptr @d }
9 ; CHECK: { ptr @c, ptr @d }
11 ;; func1 and func2 are different functions.
14 ; CHECK-LABEL: @func2(
15 ; CHECK-NEXT: ret i32 0
20 define internal i32 @a() unnamed_addr {
22 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 dso_local_equivalent @func1()
23 ; CHECK-NEXT: ret i32 [[TMP1]]
25 %1 = call i32 dso_local_equivalent @func1()
29 define internal i32 @b() unnamed_addr {
31 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 dso_local_equivalent @func2()
32 ; CHECK-NEXT: ret i32 [[TMP1]]
34 %1 = call i32 dso_local_equivalent @func2()
38 ;; func3 and func4 have the same body and signature but do not have merged
39 ;; callers because they are different functions.
41 ; CHECK-LABEL: @func3(
42 ; CHECK-NEXT: ret i32 0
47 ; CHECK-LABEL: @func4(
48 ; CHECK-NEXT: ret i32 0
53 define internal i32 @c() unnamed_addr {
55 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 dso_local_equivalent @func3()
56 ; CHECK-NEXT: ret i32 [[TMP1]]
58 %1 = call i32 dso_local_equivalent @func3()
62 define internal i32 @d() unnamed_addr {
64 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 dso_local_equivalent @func4()
65 ; CHECK-NEXT: ret i32 [[TMP1]]
67 %1 = call i32 dso_local_equivalent @func4()