Clang Project

clang_source_code/test/CodeGenOpenCL/extension-begin.cl
1// RUN: %clang_cc1 %s -triple spir-unknown-unknown -emit-llvm -o - | FileCheck %s
2
3__attribute__((overloadable)) void f(int x);
4
5#pragma OPENCL EXTENSION my_ext : begin
6
7__attribute__((overloadable)) void f(long x);
8
9#pragma OPENCL EXTENSION my_ext : end
10
11#pragma OPENCL EXTENSION my_ext : enable
12
13//CHECK: define spir_func void @test_f1(i64 %x)
14//CHECK: call spir_func void @_Z1fl(i64 %{{.*}})
15void test_f1(long x) {
16  f(x);
17}
18
19#pragma OPENCL EXTENSION my_ext : disable
20
21//CHECK: define spir_func void @test_f2(i64 %x)
22//CHECK: call spir_func void @_Z1fi(i32 %{{.*}})
23void test_f2(long x) {
24  f(x);
25}
26