[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / varargs.cpp
blob0417bf03f76d81c52319002b0e31f5f9daf3cf41
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
3 // rdar://7309675
4 // PR4678
5 namespace test0 {
6 // test1 should be compmiled to be a varargs function in the IR even
7 // though there is no way to do a va_begin. Otherwise, the optimizer
8 // will warn about 'dropped arguments' at the call site.
10 // CHECK-LABEL: define{{.*}} i32 @_ZN5test05test1Ez(...)
11 int test1(...) {
12 return -1;
15 // CHECK: call noundef i32 (...) @_ZN5test05test1Ez(i32 noundef 0)
16 void test() {
17 test1(0);
21 namespace test1 {
22 struct A {
23 int x;
24 int y;
27 void foo(...);
29 void test() {
30 A x;
31 foo(x);
33 // CHECK-LABEL: define{{.*}} void @_ZN5test14testEv()
34 // CHECK: [[X:%.*]] = alloca [[A:%.*]], align 4
35 // CHECK-NEXT: [[TMP:%.*]] = alloca [[A]], align 4
36 // CHECK-NEXT: [[T0:%.*]] = bitcast [[A]]* [[TMP]] to i8*
37 // CHECK-NEXT: [[T1:%.*]] = bitcast [[A]]* [[X]] to i8*
38 // CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 [[T0]], i8* align 4 [[T1]], i64 8, i1 false)
39 // CHECK-NEXT: [[T0:%.*]] = bitcast [[A]]* [[TMP]] to i64*
40 // CHECK-NEXT: [[T1:%.*]] = load i64, i64* [[T0]], align 4
41 // CHECK-NEXT: call void (...) @_ZN5test13fooEz(i64 [[T1]])
42 // CHECK-NEXT: ret void