|
| 1 | +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" |
| 2 | +target triple = "x86_64-unknown-linux-gnu" |
| 3 | + |
| 4 | +;; A minimal test case. llc will crash if global variables already has a section |
| 5 | +;; prefix. Subsequent PRs will expand on this test case to test the hotness |
| 6 | +;; reconciliation implementation. |
| 7 | + |
| 8 | +; RUN: not llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic \ |
| 9 | +; RUN: -partition-static-data-sections=true \ |
| 10 | +; RUN: -data-sections=true -unique-section-names=false \ |
| 11 | +; RUN: %s -o - 2>&1 | FileCheck %s --check-prefix=ERR |
| 12 | + |
| 13 | +; ERR: Global variable hot_bss already has a section prefix hot |
| 14 | + |
| 15 | +@hot_bss = internal global i32 0, !section_prefix !17 |
| 16 | + |
| 17 | +define void @hot_func() !prof !14 { |
| 18 | + %9 = load i32, ptr @hot_bss |
| 19 | + %11 = call i32 (...) @func_taking_arbitrary_param(i32 %9) |
| 20 | + ret void |
| 21 | +} |
| 22 | + |
| 23 | +declare i32 @func_taking_arbitrary_param(...) |
| 24 | + |
| 25 | +!llvm.module.flags = !{!1} |
| 26 | + |
| 27 | +!1 = !{i32 1, !"ProfileSummary", !2} |
| 28 | +!2 = !{!3, !4, !5, !6, !7, !8, !9, !10} |
| 29 | +!3 = !{!"ProfileFormat", !"InstrProf"} |
| 30 | +!4 = !{!"TotalCount", i64 1460183} |
| 31 | +!5 = !{!"MaxCount", i64 849024} |
| 32 | +!6 = !{!"MaxInternalCount", i64 32769} |
| 33 | +!7 = !{!"MaxFunctionCount", i64 849024} |
| 34 | +!8 = !{!"NumCounts", i64 23627} |
| 35 | +!9 = !{!"NumFunctions", i64 3271} |
| 36 | +!10 = !{!"DetailedSummary", !11} |
| 37 | +!11 = !{!12, !13} |
| 38 | +!12 = !{i32 990000, i64 166, i32 73} |
| 39 | +!13 = !{i32 999999, i64 3, i32 1443} |
| 40 | +!14 = !{!"function_entry_count", i64 100000} |
| 41 | +!15 = !{!"function_entry_count", i64 1} |
| 42 | +!16 = !{!"branch_weights", i32 1, i32 99999} |
| 43 | +!17 = !{!"section_prefix", !"hot"} |
0 commit comments