[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / trivial-auto-var-init-attribute.cpp
blob4b9b1c6bb526cb9e9df2a2b83abb5dd602611ce7
1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fblocks %s -emit-llvm -o - | FileCheck %s -check-prefix=UNINIT
2 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -emit-llvm -o - | FileCheck %s -check-prefix=PATTERN
3 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=zero %s -emit-llvm -o - | FileCheck %s -check-prefix=ZERO
5 template<typename T> void used(T &) noexcept;
7 extern "C" {
9 // UNINIT-LABEL: test_attribute_uninitialized(
10 // UNINIT: alloca
11 // UNINIT-NEXT: call void
12 // ZERO-LABEL: test_attribute_uninitialized(
13 // ZERO: alloca
14 // ZERO-NOT: !annotation
15 // ZERO-NEXT: call void
16 // PATTERN-LABEL: test_attribute_uninitialized(
17 // PATTERN: alloca
18 // PATTERN-NOT: !annotation
19 // PATTERN-NEXT: call void
20 void test_attribute_uninitialized() {
21 [[clang::uninitialized]] int i;
22 used(i);
25 #pragma clang attribute push([[clang::uninitialized]], apply_to = variable(is_local))
26 // UNINIT-LABEL: test_pragma_attribute_uninitialized(
27 // UNINIT: alloca
28 // UNINIT-NEXT: call void
29 // ZERO-LABEL: test_pragma_attribute_uninitialized(
30 // ZERO: alloca
31 // ZERO-NEXT: call void
32 // PATTERN-LABEL: test_pragma_attribute_uninitialized(
33 // PATTERN: alloca
34 // PATTERN-NEXT: call void
35 void test_pragma_attribute_uninitialized() {
36 int i;
37 used(i);
39 #pragma clang attribute pop
41 } // extern "C"