opt + fastcc bug?

Hi,

Is this correct behaviour?

test.ll:

declare {} @__ex__print_int(i64)

define i32 @main() {
entry:
  %0 = call i64 @f.1()
  %1 = call {} @__ex__print_int(i64 %0)
  ret i32 0
}

define internal fastcc i64 @f.1() {
entry:
  ret i64 7
}

opt -std-compile-opts test.ll -S

; ModuleID = 'test.ll'

define i32 @main() noreturn nounwind {
entry:
  tail call void @llvm.trap()
  unreachable
}

declare void @llvm.trap() nounwind

If I remove fastcc then everything works as expected.
Does this mean that one shouldn't use opt when you
use fastcc functions (which are required when implementing
tail recursive languages!)?

Thanks!
N

Try "%0 = call fastcc i64 @f.1()"; the conventions of the call and the
callee are required to match.

-Eli

See http://llvm.org/docs/FAQ.html#callconvwrong if you're wondering
why LLVM can't just take the calling convention from the
definition/declaration.

Reid