ldc/tests/codegen/gh2865.d
Martin Kinkelin dbf263aa1f Fix issue #2865 (#2867)
Functions, labels etc. aren't sized; respect that when coming across a SymOffExp (and checking whether we can elide a pointer cast to i8* for the GEP).
2018-10-08 21:04:53 +02:00

8 lines
252 B
D

// RUN: %ldc -output-ll -of=%t.ll %s && FileCheck %s < %t.ll
void foo()
{
// CHECK: %1 = getelementptr {{.*}}_D6gh28653fooFZv{{.*}} to i8*), i32 -10
// CHECK-NEXT: %2 = ptrtoint i8* %1 to i{{32|64}}
auto addr = (cast(size_t) &foo) - 10;
}