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.
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
9 %struct.S = type <{ i32, i32 }>
13 %bar = bitcast void (%struct.S*)* @foo to i32 ()*
17 define internal void @foo(%struct.S* sret) {