[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / attr-x86-no_caller_saved_registers.cpp
blobc032e38f31b315f5e1e13ebaf01a1e38235d1522
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() {}
6 namespace S {
7 // CHECK: bar{{[^#]*}}#[[ATTRS]]
8 __attribute__((no_caller_saved_registers)) void bar(int *a) { foo(); }
11 struct St {
12 static void baz(int *a) __attribute__((no_caller_saved_registers)) { S::bar(a); }
15 __attribute((no_caller_saved_registers)) void (*foobar)(void);
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;
26 // CHECK: baz{{[^#]*}}#[[ATTRS]]
28 // CHECK: attributes #[[ATTRS]] = {
29 // CHECK-SAME: "no_caller_saved_registers"
30 // CHECK-SAME: }
31 // CHECK: attributes #[[ATTRS1]] = { "no_caller_saved_registers" }