For a default visibility external linkage definition, dso_local is set for ELF
-fno-pic/-fpie and COFF and Mach-O. Since default clang -cc1 for ELF is similar
to -fpic ("PIC Level" is not set), this nuance causes unneeded binary format differences.
To make emitted IR similar, ELF -cc1 -fpic will default to -fno-semantic-interposition,
which sets dso_local for default visibility external linkage definitions.
To make this flip smooth and enable future (dso_local as definition default),
this patch replaces (function) `define ` with `define{{.*}} `,
(variable/constant/alias) `= ` with `={{.*}} `, or inserts appropriate `{{.*}} `.
26 lines
614 B
Common Lisp
26 lines
614 B
Common Lisp
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -emit-llvm -o - | FileCheck %s
|
|
|
|
__attribute__((overloadable)) void f(int x);
|
|
|
|
#pragma OPENCL EXTENSION my_ext : begin
|
|
|
|
__attribute__((overloadable)) void f(long x);
|
|
|
|
#pragma OPENCL EXTENSION my_ext : end
|
|
|
|
#pragma OPENCL EXTENSION my_ext : enable
|
|
|
|
//CHECK: define{{.*}} spir_func void @test_f1(i64 %x)
|
|
//CHECK: call spir_func void @_Z1fl(i64 %{{.*}})
|
|
void test_f1(long x) {
|
|
f(x);
|
|
}
|
|
|
|
#pragma OPENCL EXTENSION my_ext : disable
|
|
|
|
//CHECK: define{{.*}} spir_func void @test_f2(i64 %x)
|
|
//CHECK: call spir_func void @_Z1fi(i32 %{{.*}})
|
|
void test_f2(long x) {
|
|
f(x);
|
|
}
|