Dragonegg release notes.
[oota-llvm.git] / test / Transforms / SRETPromotion / 2008-06-05-non-call-use.ll
1 ; This test shows an sret function that is used as an operand to a bitcast.
2 ; StructRetPromotion used to assume that a function was only used by call or
3 ; invoke instructions, making this code cause an assertion failure.
4
5 ; We're mainly testing for opt not to crash, but we'll check to see if the sret
6 ; attribute is still there for good measure.
7 ; RUN: opt < %s -sretpromotion -S | grep sret
8
9 %struct.S = type <{ i32, i32 }>
10
11 define i32 @main() {
12 entry:
13         %bar = bitcast void (%struct.S*)* @foo to i32 ()*
14         ret i32 undef
15 }
16
17 define internal void @foo(%struct.S* sret) {
18 entry:
19         ret void
20 }