File: gh2865.d

package info (click to toggle)
ldc 1%3A1.41.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 64,576 kB
  • sloc: cpp: 91,105; ansic: 23,829; makefile: 1,518; sh: 1,056; asm: 724; objc: 135; exp: 50; python: 12
file content (13 lines) | stat: -rw-r--r-- 559 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
// REQUIRES: target_X86

// RUN: %ldc -mtriple=x86_64-linux-gnu -output-ll -of=%t_64.ll %s && FileCheck %s --check-prefix=M64 < %t_64.ll
// RUN: %ldc -mtriple=i686-linux-gnu   -output-ll -of=%t_32.ll %s && FileCheck %s --check-prefix=M32 < %t_32.ll

void foo()
{
    // M64: %1 = getelementptr inbounds i8,{{.*}}_D6gh28653fooFZv{{.*}}, i64 -10
    // M32: %1 = getelementptr inbounds i8,{{.*}}_D6gh28653fooFZv{{.*}}, i32 -10
    // M64-NEXT: %2 = ptrtoint ptr %1 to i64
    // M32-NEXT: %2 = ptrtoint ptr %1 to i32
    auto addr = (cast(size_t) &foo) - 10;
}