[PowerPC] Recommit r340016 after fixing the reported issue
[llvm-core.git] / test / Bitcode / thinlto-function-summary.ll
blob5922a8b3c4d0b1f00d7632c9db2b9c9ab2cd8a63
1 ; RUN: opt -name-anon-globals -module-summary < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC
2 ; RUN: opt -passes=name-anon-globals -module-summary < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC
3 ; Check for summary block/records.
5 ; BC: <SOURCE_FILENAME
6 ; "h"
7 ; BC-NEXT: <GLOBALVAR {{.*}} op0=0 op1=1
8 ; "foo"
9 ; BC-NEXT: <FUNCTION op0=1 op1=3
10 ; "bar"
11 ; BC-NEXT: <FUNCTION op0=4 op1=3
12 ; "anon.[32 chars].0"
13 ; BC-NEXT: <FUNCTION op0=7 op1=39
14 ; "variadic"
15 ; BC-NEXT: <FUNCTION op0=46 op1=8
16 ; "f"
17 ; BC-NEXT: <ALIAS op0=54 op1=1
18 ; BC: <GLOBALVAL_SUMMARY_BLOCK
19 ; BC-NEXT: <VERSION
20 ; BC-NEXT: <PERMODULE {{.*}} op0=1 op1=0
21 ; BC-NEXT: <PERMODULE {{.*}} op0=2 op1=0
22 ; BC-NEXT: <PERMODULE {{.*}} op0=3 op1=7
23 ; BC-NEXT: <PERMODULE {{.*}} op0=4 op1=16
24 ; BC-NEXT: <ALIAS {{.*}} op0=5 op1=0 op2=3
25 ; BC-NEXT: </GLOBALVAL_SUMMARY_BLOCK
26 ; BC: <STRTAB_BLOCK
27 ; BC-NEXT: blob data = 'hfoobaranon.{{................................}}.0variadicf{{.*}}'
30 ; RUN: opt -name-anon-globals -module-summary < %s | llvm-dis | FileCheck %s
31 ; Check that this round-trips correctly.
33 ; ModuleID = '<stdin>'
34 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
35 target triple = "x86_64-unknown-linux-gnu"
37 ; CHECK: define i32 @foo()
39 ; Function Attrs: nounwind uwtable
40 define i32 @foo() #0 {
41 entry:
42   ret i32 1
45 ; CHECK: define i32 @bar(i32 %x)
47 ; Function Attrs: nounwind uwtable
48 define i32 @bar(i32 %x) #0 {
49 entry:
50   ret i32 %x
53 ; FIXME: Anonymous function and alias not currently in summary until
54 ; follow on fixes to rename anonymous globals and emit alias summary
55 ; entries are committed.
56 ; Check an anonymous function as well, since in that case only the alias
57 ; ends up in the value symbol table and having a summary.
58 @f = alias void (), void ()* @0   ; <void ()*> [#uses=0]
59 @h = external global void ()*     ; <void ()*> [#uses=0]
61 define internal void @0() nounwind {
62 entry:
63   store void()* @0, void()** @h
64         br label %return
66 return:         ; preds = %entry
67         ret void
70 define i32 @variadic(...) {
71     ret i32 42