41 lines · plain
1; This test verifies the stable hash values for different global variables2; 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.5 6; RUN: split-file %s %t7 8; RUN: llc -mtriple=arm64-apple-darwin -enable-machine-outliner -codegen-data-generate=true -filetype=obj %t/local-g.ll -o %t/local-g.o9; RUN: llvm-cgdata --merge %t/local-g.o -o %t/local-g.cgdata10; RUN: llvm-cgdata --convert %t/local-g.cgdata -o %t/local-g.cgtext11; RUN: llc -mtriple=arm64-apple-darwin -enable-machine-outliner -codegen-data-generate=true -filetype=obj %t/local-h.ll -o %t/local-h.o12; RUN: llvm-cgdata --merge %t/local-h.o -o %t/local-h.cgdata13; RUN: llvm-cgdata --convert %t/local-h.cgdata -o %t/local-h.cgtext14 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 %s18; CHECK: 219 20;--- local-g.ll21declare i32 @g(i32, i32, i32)22define i32 @f1() minsize {23 %1 = call i32 @g(i32 10, i32 1, i32 2);24 ret i32 %125}26define i32 @f2() minsize {27 %1 = call i32 @g(i32 20, i32 1, i32 2);28 ret i32 %129}30 31;--- local-h.ll32declare i32 @h(i32, i32, i32)33define i32 @f1() minsize {34 %1 = call i32 @h(i32 10, i32 1, i32 2);35 ret i32 %136}37define i32 @f2() minsize {38 %1 = call i32 @h(i32 20, i32 1, i32 2);39 ret i32 %140}41