1 ; This test verifies that global variables (string) are hashed based on their initial contents,
2 ; allowing them to be merged even if they appear different due to their names.
3 ; Now they become identical functions that can be merged without creating a parameter.
5 ; RUN: llc -mtriple=arm64-apple-darwin -enable-global-merge-func=true -global-merging-skip-no-params=false < %s | FileCheck %s
12 ; The initial contents of `.str` and `.str.1` are identical, but not with those of `.str.2` and `.str.3`.
13 @.str = private unnamed_addr constant [6 x i8] c"hello\00", align 1
14 @.str.1 = private unnamed_addr constant [6 x i8] c"hello\00", align 1
15 @.str.2 = private unnamed_addr constant [6 x i8] c"diff2\00", align 1
16 @.str.3 = private unnamed_addr constant [6 x i8] c"diff3\00", align 1
18 declare i32 @goo(ptr noundef)
22 %call = tail call i32 @goo(ptr noundef nonnull @.str)
23 %add = add nsw i32 %call, 1
29 %call = tail call i32 @goo(ptr noundef nonnull @.str.1)
30 %add = add nsw i32 %call, 1
36 %call = tail call noundef i32 @goo(ptr noundef nonnull @.str.2)
37 %add = sub nsw i32 %call, 1
43 %call = tail call noundef i32 @goo(ptr noundef nonnull @.str.3)
44 %add = sub nsw i32 %call, 1