1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu %s -emit-llvm -o - | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64-pc-win32 %s -emit-llvm -o - | FileCheck %s
4 // CHECK: foo{{[^#]*}}#[[ATTRS:[0-9]+]]
5 __attribute__((no_caller_saved_registers
)) void foo() {}
7 // CHECK: bar{{[^#]*}}#[[ATTRS]]
8 __attribute__((no_caller_saved_registers
)) void bar(int *a
) { foo(); }
12 static void baz(int *a
) __attribute__((no_caller_saved_registers
)) { S::bar(a
); }
15 __attribute((no_caller_saved_registers
)) void (*foobar
)(void);
18 int main(int argc
, char **argv
) {
20 // CHECK: [[FOOBAR:%.+]] = load ptr, ptr @{{.*}}foobar{{.*}},
21 // CHECK-NEXT: call void [[FOOBAR]]() #[[ATTRS1:.+]]
26 // CHECK: baz{{[^#]*}}#[[ATTRS]]
28 // CHECK: attributes #[[ATTRS]] = {
29 // CHECK-SAME: "no_caller_saved_registers"
31 // CHECK: attributes #[[ATTRS1]] = { "no_caller_saved_registers" }