Teresa Johnson | 403a787 | 2015-10-04 14:33:43 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as -function-summary < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC |
| 2 | ; Check for function summary block/records. |
| 3 | |
| 4 | ; BC: <FUNCTION_SUMMARY_BLOCK |
| 5 | ; BC-NEXT: <PERMODULE_ENTRY |
| 6 | ; BC-NEXT: <PERMODULE_ENTRY |
| 7 | ; BC-NEXT: <PERMODULE_ENTRY |
| 8 | ; BC-NEXT: </FUNCTION_SUMMARY_BLOCK |
| 9 | |
| 10 | ; RUN: llvm-as -function-summary < %s | llvm-dis | FileCheck %s |
| 11 | ; Check that this round-trips correctly. |
| 12 | |
| 13 | ; ModuleID = '<stdin>' |
| 14 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 15 | target triple = "x86_64-unknown-linux-gnu" |
| 16 | |
| 17 | ; CHECK: define i32 @foo() |
| 18 | |
| 19 | ; Function Attrs: nounwind uwtable |
| 20 | define i32 @foo() #0 { |
| 21 | entry: |
| 22 | ret i32 1 |
| 23 | } |
| 24 | |
| 25 | ; CHECK: define i32 @bar(i32 %x) |
| 26 | |
| 27 | ; Function Attrs: nounwind uwtable |
| 28 | define i32 @bar(i32 %x) #0 { |
| 29 | entry: |
| 30 | ret i32 %x |
| 31 | } |
| 32 | |
| 33 | ; Check an anonymous function as well, since in that case only the alias |
| 34 | ; ends up in the value symbol table and having a summary. |
| 35 | @f = alias void (), void ()* @0 ; <void ()*> [#uses=0] |
| 36 | @h = external global void ()* ; <void ()*> [#uses=0] |
| 37 | |
| 38 | define internal void @0() nounwind { |
| 39 | entry: |
| 40 | store void()* @0, void()** @h |
| 41 | br label %return |
| 42 | |
| 43 | return: ; preds = %entry |
| 44 | ret void |
| 45 | } |