| 1 |
// RUN: %clang_cc1 -mrtd -triple i386-unknown-unknown -std=c89 -emit-llvm -o - %s 2>&1 | FileCheck --check-prefixes=CHECK,X86 %s |
| 2 |
// RUN: %clang_cc1 -mrtd -triple m68k-unknown-unknown -std=c89 -emit-llvm -o - %s 2>&1 | FileCheck --check-prefixes=CHECK,M68K %s |
| 3 |
|
| 4 |
void baz(int arg); |
| 5 |
|
| 6 |
// X86: define{{.*}} x86_stdcallcc void @foo(i32 noundef %arg) [[NUW:#[0-9]+]] |
| 7 |
// M68K: define{{.*}} m68k_rtdcc void @foo(i32 noundef %arg) |
| 8 |
void foo(int arg) { |
| 9 |
// X86: call x86_stdcallcc i32 @bar( |
| 10 |
#ifndef __mc68000__ |
| 11 |
bar(arg); |
| 12 |
#endif |
| 13 |
// X86: call x86_stdcallcc void @baz(i32 |
| 14 |
// M68K: call m68k_rtdcc void @baz(i32 |
| 15 |
baz(arg); |
| 16 |
} |
| 17 |
|
| 18 |
// X86: declare x86_stdcallcc i32 @bar(...) |
| 19 |
|
| 20 |
// X86: declare x86_stdcallcc void @baz(i32 noundef) |
| 21 |
// M68K: declare m68k_rtdcc void @baz(i32 noundef) |
| 22 |
|
| 23 |
void qux(int arg, ...) { } |
| 24 |
// CHECK: define{{.*}} void @qux(i32 noundef %arg, ...) |
| 25 |
|
| 26 |
void quux(int a1, int a2, int a3) { |
| 27 |
qux(a1, a2, a3); |
| 28 |
} |
| 29 |
// X86-LABEL: define{{.*}} x86_stdcallcc void @quux |
| 30 |
// M68K-LABEL: define{{.*}} m68k_rtdcc void @quux |
| 31 |
// CHECK: call void (i32, ...) @qux |
| 32 |
|
| 33 |
// X86: attributes [[NUW]] = { noinline nounwind{{.*}} } |