File tree 2 files changed +5
-0
lines changed
tools/clang-offload-bundler
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 25
25
26
26
const __attribute__((opencl_constant )) char const_as [] = "abc" ;
27
27
28
+ extern void my_printf (__attribute__((opencl_constant )) const char * fmt );
29
+
28
30
extern void undefined_func (void );
29
31
30
32
void foo (void ) {
33
+ // We aim to create a gep operator in LLVM IR to have a use of const_as
34
+ my_printf (& const_as [1 ]);
31
35
undefined_func ();
32
36
}
33
37
Original file line number Diff line number Diff line change @@ -653,6 +653,7 @@ class ObjectFileHandler final : public FileHandler {
653
653
// Do not add globals with constant address space to the tgtsym.
654
654
if (!GV.isDeclaration () && !GV.hasLocalLinkage () &&
655
655
GV.getAddressSpace () == 2 ) {
656
+ GV.replaceAllUsesWith (UndefValue::get (GV.getType ()));
656
657
GV.dropAllReferences ();
657
658
GV.eraseFromParent ();
658
659
UpdateBuf = true ;
You can’t perform that action at this time.
0 commit comments