blob: fd72d4a39cb37330d96f734a0bc94f663c6a5708 [file] [log] [blame]
Hans Wennborg40ccbd32018-10-26 13:05:45 +00001// RUN: %clang_cc1 -std=c++2a -emit-llvm %s -o - -triple %itanium_abi_triple | FileCheck %s --check-prefix=ITANIUM
2// RUN: not %clang_cc1 -std=c++2a -emit-llvm %s -o - -triple %ms_abi_triple 2>&1 | FileCheck %s --check-prefix=MSABI
Richard Smithc70f1d62017-12-14 15:16:18 +00003// RUN: not %clang_cc1 -std=c++2a -emit-llvm %s -o - -triple %itanium_abi_triple -DBUILTIN 2>&1 | FileCheck %s --check-prefix=BUILTIN
Hans Wennborg40ccbd32018-10-26 13:05:45 +00004// MSABI: cannot mangle this three-way comparison operator yet
Richard Smithd30b23d2017-12-01 02:13:10 +00005
6struct A {
7 void operator<=>(int);
8};
9
10// ITANIUM: define {{.*}}@_ZN1AssEi(
11void A::operator<=>(int) {}
12
13// ITANIUM: define {{.*}}@_Zssi1A(
14void operator<=>(int, A) {}
Richard Smithc70f1d62017-12-14 15:16:18 +000015
16int operator<=>(A, A);
17
18// ITANIUM: define {{.*}}_Z1f1A(
19int f(A a) {
20 // ITANIUM: %[[RET:.*]] = call {{.*}}_Zss1AS_(
Hans Wennborg40ccbd32018-10-26 13:05:45 +000021 // ITANIUM: ret i32 %[[RET]]
Richard Smithc70f1d62017-12-14 15:16:18 +000022 return a <=> a;
23}
24
25#ifdef BUILTIN
26void builtin(int a) {
27 a <=> a; // BUILTIN: cannot compile this scalar expression yet
28}
29#endif