150
|
1 // RUN: %clang_cc1 -mrtd -triple i386-unknown-unknown -std=c89 -emit-llvm -o - %s 2>&1 | FileCheck %s
|
|
2
|
|
3 // CHECK: mrtd.c:10:3: warning: function with no prototype cannot use the stdcall calling convention
|
|
4
|
|
5 void baz(int arg);
|
|
6
|
207
|
7 // CHECK: define{{.*}} x86_stdcallcc void @foo(i32 %arg) [[NUW:#[0-9]+]]
|
150
|
8 void foo(int arg) {
|
|
9 // CHECK: call x86_stdcallcc i32 bitcast (i32 (...)* @bar to i32 (i32)*)(
|
|
10 bar(arg);
|
|
11 // CHECK: call x86_stdcallcc void @baz(i32
|
|
12 baz(arg);
|
|
13 }
|
|
14
|
|
15 // CHECK: declare x86_stdcallcc i32 @bar(...)
|
|
16
|
|
17 // CHECK: declare x86_stdcallcc void @baz(i32)
|
|
18
|
|
19 void qux(int arg, ...) { }
|
207
|
20 // CHECK: define{{.*}} void @qux(i32 %arg, ...)
|
150
|
21
|
|
22 void quux(int a1, int a2, int a3) {
|
|
23 qux(a1, a2, a3);
|
|
24 }
|
207
|
25 // CHECK-LABEL: define{{.*}} x86_stdcallcc void @quux
|
150
|
26 // CHECK: call void (i32, ...) @qux
|
|
27
|
|
28 // CHECK: attributes [[NUW]] = { noinline nounwind{{.*}} }
|