summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/arm64-microsoft-arguments.cpp
blob: 3ef468880ad76dd1f8842aa10bd81e7ac2335d43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// RUN: %clang_cc1 -triple aarch64-windows -ffreestanding -emit-llvm -O0 \
// RUN: -x c++ -o - %s | FileCheck %s

struct pod { int a, b, c, d, e; };

struct non_pod {
  int a;
  non_pod() {}
};

struct pod s;
struct non_pod t;

struct pod bar() { return s; }
struct non_pod foo() { return t; }
// CHECK: define {{.*}} void @{{.*}}bar{{.*}}(%struct.pod* noalias sret %agg.result)
// CHECK: define {{.*}} void @{{.*}}foo{{.*}}(%struct.non_pod* noalias %agg.result)


// Check instance methods.
struct pod2 { int x; };
struct Baz { pod2 baz(); };

int qux() { return Baz().baz().x; }
// CHECK: declare {{.*}} void @{{.*}}baz@Baz{{.*}}(%struct.Baz*, %struct.pod2*)