[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGenCoroutines / coro-alloc-2.cpp
blob8f4b8c5241f606fc61645ce2abf290d103e63af8
1 // Tests that we wouldn't generate an allocation call in global scope with (std::size_t, p0, ..., pn)
2 // RUN: %clang_cc1 %s -std=c++20 -S -triple x86_64-unknown-linux-gnu -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s
3 #include "Inputs/coroutine.h"
5 namespace std {
6 typedef decltype(sizeof(int)) size_t;
9 struct Allocator {};
11 struct resumable {
12 struct promise_type {
14 resumable get_return_object() { return {}; }
15 auto initial_suspend() { return std::suspend_always(); }
16 auto final_suspend() noexcept { return std::suspend_always(); }
17 void unhandled_exception() {}
18 void return_void(){};
22 void *operator new(std::size_t, void *);
24 resumable f1(void *) {
25 co_return;
28 // CHECK: coro.alloc:
29 // CHECK-NEXT: [[SIZE:%.+]] = call [[BITWIDTH:.+]] @llvm.coro.size.[[BITWIDTH]]()
30 // CHECK-NEXT: call {{.*}} ptr @_Znwm([[BITWIDTH]] noundef [[SIZE]])