Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit d077ad4

Browse files
committed
AMDGPU: Add test for generic builtin behavior
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266383 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 648689c commit d077ad4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// REQUIRES: amdgpu-registered-target
2+
// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -S -emit-llvm -o - %s | FileCheck %s
3+
4+
// CHECK-LABEL: @test_builtin_clz(
5+
// CHECK: tail call i32 @llvm.ctlz.i32(i32 %a, i1 true)
6+
void test_builtin_clz(global int* out, int a)
7+
{
8+
*out = __builtin_clz(a);
9+
}
10+
11+
// CHECK-LABEL: @test_builtin_clzl(
12+
// CHECK: tail call i64 @llvm.ctlz.i64(i64 %a, i1 true)
13+
void test_builtin_clzl(global long* out, long a)
14+
{
15+
*out = __builtin_clzl(a);
16+
}

0 commit comments

Comments
 (0)