Clang Project

clang_source_code/test/CodeGen/arm64-microsoft-arguments.cpp
1// RUN: %clang_cc1 -triple aarch64-windows -ffreestanding -emit-llvm -O0 \
2// RUN: -x c++ -o - %s | FileCheck %s
3
4struct pod { int a, b, c, d, e; };
5
6struct non_pod {
7  int a;
8  non_pod() {}
9};
10
11struct pod s;
12struct non_pod t;
13
14struct pod bar() { return s; }
15struct non_pod foo() { return t; }
16// CHECK: define {{.*}} void @{{.*}}bar{{.*}}(%struct.pod* noalias sret %agg.result)
17// CHECK: define {{.*}} void @{{.*}}foo{{.*}}(%struct.non_pod* noalias %agg.result)
18
19
20// Check instance methods.
21struct pod2 { int x; };
22struct Baz { pod2 baz(); };
23
24int qux() { return Baz().baz().x; }
25// CHECK: declare {{.*}} void @{{.*}}baz@Baz{{.*}}(%struct.Baz*, %struct.pod2*)
26