Declare that musttail calls in variadic functions forward the ellipsis
[oota-llvm.git] / test / Assembler / musttail.ll
diff --git a/test/Assembler/musttail.ll b/test/Assembler/musttail.ll
new file mode 100644 (file)
index 0000000..6e2a9b2
--- /dev/null
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llvm-dis | FileCheck %s
+
+; Check that the ellipsis round trips.
+
+%struct.A = type { i32 }
+
+declare i8* @f(i8*, ...)
+
+define i8* @f_thunk(i8* %this, ...) {
+  %rv = musttail call i8* (i8*, ...)* @f(i8* %this, ...)
+  ret i8* %rv
+}
+; CHECK-LABEL: define i8* @f_thunk(i8* %this, ...)
+; CHECK: %rv = musttail call i8* (i8*, ...)* @f(i8* %this, ...)