function-metadata-bad.ll 878 B

1234567891011121314151617181920212223242526272829303132333435
  1. ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
  2. define i32 @bad1() !prof !0 {
  3. ret i32 0
  4. }
  5. !0 = !{i32 123, i32 3}
  6. ; CHECK: assembly parsed, but does not verify as correct!
  7. ; CHECK-NEXT: expected string with name of the !prof annotation
  8. ; CHECK-NEXT: !0 = !{i32 123, i32 3}
  9. define i32 @bad2() !prof !1 {
  10. ret i32 0
  11. }
  12. !1 = !{!"function_entry_count"}
  13. ; CHECK-NEXT: !prof annotations should have exactly 2 operands
  14. ; CHECK-NEXT: !1 = !{!"function_entry_count"}
  15. define i32 @bad3() !prof !2 {
  16. ret i32 0
  17. }
  18. !2 = !{!"some_other_count", i64 200}
  19. ; CHECK-NEXT: first operand should be 'function_entry_count'
  20. ; CHECK-NEXT: !2 = !{!"some_other_count", i64 200}
  21. define i32 @bad4() !prof !3 {
  22. ret i32 0
  23. }
  24. !3 = !{!"function_entry_count", !"string"}
  25. ; CHECK-NEXT: expected integer argument to function_entry_count
  26. ; CHECK-NEXT: !3 = !{!"function_entry_count", !"string"}