[Xtensa] Implement Windowed Register Option. (#124656)
[llvm-project.git] / llvm / test / CodeGen / AArch64 / cgdata-global-hash.ll
blobc425eda56f5d5bdc5bef14e47231afab32af778c
1 ; This test verifies the stable hash values for different global variables
2 ; that have distinct names.
3 ; We generate two different cgdata files from nearly identical outline instances,
4 ; with the only difference being the last call target globals, @g vs @h.
6 ; RUN: split-file %s %t
8 ; RUN: llc -mtriple=arm64-apple-darwin -enable-machine-outliner -codegen-data-generate=true -filetype=obj %t/local-g.ll -o %t/local-g.o
9 ; RUN: llvm-cgdata --merge %t/local-g.o -o %t/local-g.cgdata
10 ; RUN: llvm-cgdata --convert %t/local-g.cgdata -o %t/local-g.cgtext
11 ; RUN: llc -mtriple=arm64-apple-darwin -enable-machine-outliner -codegen-data-generate=true -filetype=obj %t/local-h.ll -o %t/local-h.o
12 ; RUN: llvm-cgdata --merge %t/local-h.o -o %t/local-h.cgdata
13 ; RUN: llvm-cgdata --convert %t/local-h.cgdata -o %t/local-h.cgtext
15 ; We compare the trees which are only different at the terminal node's hash value.
16 ; Here we simply count the different lines that have `Hash` string.
17 ; RUN: not diff %t/local-g.cgtext %t/local-h.cgtext 2>&1 | grep Hash | wc -l | FileCheck %s
18 ; CHECK: 2
20 ;--- local-g.ll
21 declare i32 @g(i32, i32, i32)
22 define i32 @f1() minsize {
23   %1 = call i32 @g(i32 10, i32 1, i32 2);
24   ret i32 %1
26 define i32 @f2() minsize {
27   %1 = call i32 @g(i32 20, i32 1, i32 2);
28   ret i32 %1
31 ;--- local-h.ll
32 declare i32 @h(i32, i32, i32)
33 define i32 @f1() minsize {
34   %1 = call i32 @h(i32 10, i32 1, i32 2);
35   ret i32 %1
37 define i32 @f2() minsize {
38   %1 = call i32 @h(i32 20, i32 1, i32 2);
39   ret i32 %1