| 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
|
| 3 |
|
| 4 | // CHECK: foo{{[^#]*}}#[[ATTRS:[0-9]+]]
|
| 5 | __attribute__((no_caller_saved_registers)) void foo() {}
|
| 6 | namespace S {
|
| 7 | // CHECK: bar{{[^#]*}}#[[ATTRS]]
|
| 8 | __attribute__((no_caller_saved_registers)) void bar(int *a) { foo(); }
|
| 9 | }
|
| 10 |
|
| 11 | struct St {
|
| 12 | static void baz(int *a) __attribute__((no_caller_saved_registers)) { S::bar(a); }
|
| 13 | };
|
| 14 |
|
| 15 | __attribute((no_caller_saved_registers)) void (*foobar)(void);
|
| 16 |
|
| 17 | // CHECK-LABEL: @main
|
| 18 | int main(int argc, char **argv) {
|
| 19 | St::baz(&argc);
|
| 20 | // CHECK: [[FOOBAR:%.+]] = load void ()*, void ()** @{{.*}}foobar{{.*}},
|
| 21 | // CHECK-NEXT: call void [[FOOBAR]]() #[[ATTRS1:.+]]
|
| 22 | foobar();
|
| 23 | return 0;
|
| 24 | }
|
| 25 |
|
| 26 | // CHECK: baz{{[^#]*}}#[[ATTRS]]
|
| 27 |
|
| 28 | // CHECK: attributes #[[ATTRS]] = {
|
| 29 | // CHECK-SAME: "no_caller_saved_registers"
|
| 30 | // CHECK-SAME: }
|
| 31 | // CHECK: attributes #[[ATTRS1]] = { "no_caller_saved_registers" }
|
| 32 | |