From cd00f564f86c4a35e08a26a815a3803d531e0b78 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Wed, 17 Oct 2018 00:19:21 +0000 Subject: [PATCH] [ThinLTO] Fix test to require asserts New test added in r344658 requires asserts due to -stats. While here, augment it to test new global variable importing message as well. llvm-svn: 344660 --- llvm/test/Transforms/FunctionImport/Inputs/import_stats.ll | 3 +++ llvm/test/Transforms/FunctionImport/import_stats.ll | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/llvm/test/Transforms/FunctionImport/Inputs/import_stats.ll b/llvm/test/Transforms/FunctionImport/Inputs/import_stats.ll index 4313883..818fbf2 100644 --- a/llvm/test/Transforms/FunctionImport/Inputs/import_stats.ll +++ b/llvm/test/Transforms/FunctionImport/Inputs/import_stats.ll @@ -2,7 +2,10 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@globalvar = global i32 1, align 4 + define void @hot() { + store i32 0, i32* @globalvar, align 4 ret void } define void @critical() { diff --git a/llvm/test/Transforms/FunctionImport/import_stats.ll b/llvm/test/Transforms/FunctionImport/import_stats.ll index 4354085..03f5f8f 100644 --- a/llvm/test/Transforms/FunctionImport/import_stats.ll +++ b/llvm/test/Transforms/FunctionImport/import_stats.ll @@ -1,5 +1,8 @@ ; Test to check thin link importing stats +; -stats requires asserts +; REQUIRES: asserts + ; RUN: opt -module-summary %s -o %t.bc ; RUN: opt -module-summary %p/Inputs/import_stats.ll -o %t2.bc @@ -14,8 +17,10 @@ ; RUN: -r %t2.bc,hot,plx \ ; RUN: -r %t2.bc,critical,plx \ ; RUN: -r %t2.bc,none,plx \ +; RUN: -r %t2.bc,globalvar,plx \ ; RUN: 2>&1 | FileCheck %s --check-prefix=THINLINKSTATS +; THINLINKSTATS-DAG: 1 function-import - Number of global variables thin link decided to import ; THINLINKSTATS-DAG: 1 function-import - Number of critical functions thin link decided to import ; THINLINKSTATS-DAG: 3 function-import - Number of functions thin link decided to import ; THINLINKSTATS-DAG: 1 function-import - Number of hot functions thin link decided to import -- 2.7.4