diff options
author | Haibo Huang <hhb@google.com> | 2018-12-12 22:04:12 +0000 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2018-12-12 22:04:12 +0000 |
commit | 6b22f592075f239d5d666a7994ff1680050f6580 (patch) | |
tree | f4882d498bd0ac3e684e80c2c70f62be3429516c /clang/test/CodeGen/builtin-cpu-supports.c | |
parent | 5cdc2cda28ac86ba4ec3771341545355452fdc86 (diff) | |
download | bcm5719-llvm-6b22f592075f239d5d666a7994ff1680050f6580.tar.gz bcm5719-llvm-6b22f592075f239d5d666a7994ff1680050f6580.zip |
Declares __cpu_model as dso local
__builtin_cpu_supports and __builtin_cpu_is use information in __cpu_model to decide cpu features. Before this change, __cpu_model was not declared as dso local. The generated code looks up the address in GOT when reading __cpu_model. This makes it impossible to use these functions in ifunc, because at that time GOT entries have not been relocated. This change makes it dso local.
Differential Revision: https://reviews.llvm.org/D53850
llvm-svn: 348978
Diffstat (limited to 'clang/test/CodeGen/builtin-cpu-supports.c')
-rw-r--r-- | clang/test/CodeGen/builtin-cpu-supports.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/CodeGen/builtin-cpu-supports.c b/clang/test/CodeGen/builtin-cpu-supports.c index d384efbc208..761f00cf957 100644 --- a/clang/test/CodeGen/builtin-cpu-supports.c +++ b/clang/test/CodeGen/builtin-cpu-supports.c @@ -4,6 +4,9 @@ // global, the bit grab, and the icmp correct. extern void a(const char *); +// CHECK: @__cpu_model = external dso_local global { i32, i32, i32, [1 x i32] } +// CHECK: @__cpu_features2 = external dso_local global i32 + int main() { __builtin_cpu_init(); @@ -25,3 +28,5 @@ int main() { return 0; } + +// CHECK: declare dso_local void @__cpu_indicator_init() |