Skip to content

Commit 6f50071

Browse files
committed
Get test ready
1 parent 46a5e9f commit 6f50071

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

clang/test/CIR/CodeGen/builtins-memory.c

Lines changed: 0 additions & 15 deletions
This file was deleted.

clang/test/CIR/CodeGen/builtins.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,14 @@ int *test_std_addressof2() {
5656
// LLVM: [[RES:%.*]] = load ptr, ptr [[ADDR]], align 8
5757
// LLVM: ret ptr [[RES]]
5858
}
59+
60+
extern "C" void *test_return_address(void) {
61+
return __builtin_return_address(1);
62+
63+
// CIR-LABEL: test_return_address
64+
// [[ARG:%.*]] = cir.const #cir.int<1> : !u32i
65+
// {{%.*}} = cir.llvm.intrinsic "llvm.returnaddress" [[ARG]] : (!u32i) -> !cir.ptr<!void>
66+
67+
// LLVM-LABEL: @test_return_address
68+
// LLVM: {{%.*}} = call ptr @llvm.returnaddress(i32 1)
69+
}

0 commit comments

Comments
 (0)