diff options
| author | Hans Wennborg <hans@hanshq.net> | 2018-08-21 22:39:17 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2018-08-21 22:39:17 +0000 |
| commit | d8568622e6c4df768f8963d7b80d2d47e5b8f03b (patch) | |
| tree | 86ff9b8fb32464da10c93826584daa6c245fa190 /clang/test/OpenMP/declare_target_codegen.cpp | |
| parent | e23b77ca937f826d0561c0a02a1b5a414a3fc148 (diff) | |
| download | bcm5719-llvm-d8568622e6c4df768f8963d7b80d2d47e5b8f03b.tar.gz bcm5719-llvm-d8568622e6c4df768f8963d7b80d2d47e5b8f03b.zip | |
Merging r340191:
------------------------------------------------------------------------
r340191 | abataev | 2018-08-20 20:03:40 +0200 (Mon, 20 Aug 2018) | 6 lines
[OPENMP] Fix crash on the emission of the weak function declaration.
If the function is actually a weak reference, it should not be marked as
deferred definition as this is only a declaration. Patch adds checks for
the definitions if they must be emitted. Otherwise, only declaration is
emitted.
------------------------------------------------------------------------
llvm-svn: 340351
Diffstat (limited to 'clang/test/OpenMP/declare_target_codegen.cpp')
| -rw-r--r-- | clang/test/OpenMP/declare_target_codegen.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/OpenMP/declare_target_codegen.cpp b/clang/test/OpenMP/declare_target_codegen.cpp index 96bdc874ece..abd108a6e78 100644 --- a/clang/test/OpenMP/declare_target_codegen.cpp +++ b/clang/test/OpenMP/declare_target_codegen.cpp @@ -91,5 +91,19 @@ int baz2() { return 2 + baz3(); } +extern int create() throw(); + +static __typeof(create) __t_create __attribute__((__weakref__("__create"))); + +int baz5() { + bool a; +// CHECK-DAG: define weak void @__omp_offloading_{{.*}}baz5{{.*}}_l[[@LINE+1]](i64 {{.*}}) +#pragma omp target + a = __extension__(void *) & __t_create != 0; + return a; +} + +// CHECK-DAG: declare extern_weak signext i32 @__create() + // CHECK-NOT: define {{.*}}{{baz1|baz4|maini1}} #endif // HEADER |

