1 ; This test lures sretpromotion into promoting the sret argument of foo, even
2 ; when the function is used as an argument to bar. It used to not check for
3 ; this, assuming that all users of foo were direct calls, resulting in an
4 ; assertion failure later on.
6 ; We're mainly testing for opt not to crash, but we'll check to see if the sret
7 ; attribute is still there for good measure.
8 ; RUN: llvm-as < %s | opt -sretpromotion | llvm-dis | grep sret
10 %struct.S = type <{ i32, i32 }>
14 %tmp = alloca %struct.S ; <%struct.S*> [#uses=1]
15 call void @bar( %struct.S* sret %tmp, void (%struct.S*, ...)* @foo )
19 declare void @bar(%struct.S* sret , void (%struct.S*, ...)*)
21 define internal void @foo(%struct.S* sret %agg.result, ...) {