blob: 511b1c3140965ba25973cafaec75ec1f664d10da [file] [log] [blame]
Teresa Johnson26ab5772016-03-15 00:04:37 +00001; RUN: llvm-as -module-summary < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC
2; Check for summary block/records.
Teresa Johnson403a7872015-10-04 14:33:43 +00003
Teresa Johnson26ab5772016-03-15 00:04:37 +00004; Check the value ids in the summary entries against the
Teresa Johnsona9a63072016-02-01 23:26:30 +00005; same in the ValueSumbolTable, to ensure the ordering is stable.
Teresa Johnson5e22e442016-02-06 16:07:35 +00006; Also check the linkage field on the summary entries.
Teresa Johnson76a1c1d2016-03-11 18:52:24 +00007; BC: <GLOBALVAL_SUMMARY_BLOCK
8; BC-NEXT: <PERMODULE {{.*}} op0=1 op1=0
9; BC-NEXT: <PERMODULE {{.*}} op0=2 op1=0
10; BC-NEXT: <PERMODULE {{.*}} op0=4 op1=3
11; BC-NEXT: </GLOBALVAL_SUMMARY_BLOCK
Teresa Johnsona9a63072016-02-01 23:26:30 +000012; BC-NEXT: <VALUE_SYMTAB
13; BC-NEXT: <FNENTRY {{.*}} op0=1 {{.*}}> record string = 'foo'
14; BC-NEXT: <FNENTRY {{.*}} op0=2 {{.*}}> record string = 'bar'
15; BC-NEXT: <FNENTRY {{.*}} op0=4 {{.*}}> record string = 'f'
Teresa Johnson403a7872015-10-04 14:33:43 +000016
Teresa Johnson26ab5772016-03-15 00:04:37 +000017; RUN: llvm-as -module-summary < %s | llvm-dis | FileCheck %s
Teresa Johnson403a7872015-10-04 14:33:43 +000018; Check that this round-trips correctly.
19
20; ModuleID = '<stdin>'
21target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
22target triple = "x86_64-unknown-linux-gnu"
23
24; CHECK: define i32 @foo()
25
26; Function Attrs: nounwind uwtable
27define i32 @foo() #0 {
28entry:
29 ret i32 1
30}
31
32; CHECK: define i32 @bar(i32 %x)
33
34; Function Attrs: nounwind uwtable
35define i32 @bar(i32 %x) #0 {
36entry:
37 ret i32 %x
38}
39
40; Check an anonymous function as well, since in that case only the alias
41; ends up in the value symbol table and having a summary.
42@f = alias void (), void ()* @0 ; <void ()*> [#uses=0]
43@h = external global void ()* ; <void ()*> [#uses=0]
44
45define internal void @0() nounwind {
46entry:
47 store void()* @0, void()** @h
48 br label %return
49
50return: ; preds = %entry
51 ret void
52}