[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / attr-annotate2.cpp
blobaab75d8853d4c879cbe27729f016ac8b76e2b058
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 %s -S -emit-llvm -triple x86_64-unknown-linux-gnu -o - | FileCheck %s
4 // CHECK: @[[STR:.*]] = private unnamed_addr constant [45 x i8] c"_Generic selection expression should be fine\00", section "llvm.metadata"
5 // CHECK-NEXT: @[[FILENAME:.*]] = private unnamed_addr constant {{.*}}, section "llvm.metadata"
6 // CHECK-NEXT: @[[ARGS:.*]] = private unnamed_addr constant { i32 } zeroinitializer, section "llvm.metadata"
8 // CHECK-LABEL: @_Z1fv(
9 // CHECK-NEXT: entry:
10 // CHECK-NEXT: [[N:%.*]] = alloca i32, align 4
11 // CHECK-NEXT: [[J:%.*]] = alloca i32, align 4
12 // CHECK-NEXT: store i32 10, i32* [[N]], align 4
13 // CHECK-NEXT: [[J1:%.*]] = bitcast i32* [[J]] to i8*
14 // CHECK-NEXT: call void @llvm.var.annotation(i8* [[J1]], i8* getelementptr inbounds ([45 x i8], [45 x i8]* @[[STR]], i32 0, i32 0), i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @[[FILENAME]], i32 0, i32 0), i32 {{.*}}, i8* bitcast ({ i32 }* @[[ARGS]] to i8*))
15 // CHECK-NEXT: store i32 0, i32* [[J]], align 4
16 // CHECK-NEXT: ret void
18 void f() {
19 int n = 10;
20 [[clang::annotate("_Generic selection expression should be fine", _Generic(n, int : 0, default : 1))]]
21 int j = 0; // second arg should resolve to 0 fine