2015-01-18 16:23:48 +00:00
|
|
|
// RUN: %clang_cc1 -mrtd -triple i386-unknown-unknown -std=c89 -emit-llvm -o - %s 2>&1 | FileCheck %s
|
|
|
|
|
|
|
|
// CHECK: mrtd.c:10:3: warning: function with no prototype cannot use the stdcall calling convention
|
2011-05-02 19:39:53 +00:00
|
|
|
|
|
|
|
void baz(int arg);
|
|
|
|
|
2013-04-08 18:45:10 +00:00
|
|
|
// CHECK: define x86_stdcallcc void @foo(i32 %arg) [[NUW:#[0-9]+]]
|
2011-05-02 19:39:53 +00:00
|
|
|
void foo(int arg) {
|
2011-10-20 21:14:49 +00:00
|
|
|
// CHECK: call x86_stdcallcc i32 bitcast (i32 (...)* @bar to i32 (i32)*)(
|
2011-05-02 19:39:53 +00:00
|
|
|
bar(arg);
|
|
|
|
// CHECK: call x86_stdcallcc void @baz(i32
|
|
|
|
baz(arg);
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK: declare x86_stdcallcc i32 @bar(...)
|
|
|
|
|
|
|
|
// CHECK: declare x86_stdcallcc void @baz(i32)
|
2013-04-08 18:45:10 +00:00
|
|
|
|
2013-12-22 00:07:40 +00:00
|
|
|
void qux(int arg, ...) { }
|
|
|
|
// CHECK: define void @qux(i32 %arg, ...)
|
|
|
|
|
|
|
|
void quux(int a1, int a2, int a3) {
|
|
|
|
qux(a1, a2, a3);
|
|
|
|
}
|
|
|
|
// CHECK-LABEL: define x86_stdcallcc void @quux
|
2015-05-27 18:47:56 +00:00
|
|
|
// CHECK: call void (i32, ...) @qux
|
2013-12-22 00:07:40 +00:00
|
|
|
|
2017-01-02 19:18:08 +00:00
|
|
|
// CHECK: attributes [[NUW]] = { noinline nounwind{{.*}} }
|