File: pragma_no_typeinfo.d

package info (click to toggle)
ldc 1%3A1.30.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 59,248 kB
  • sloc: cpp: 61,598; ansic: 14,545; sh: 1,014; makefile: 972; asm: 510; objc: 135; exp: 48; python: 12
file content (29 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Make sure the LDC_no_typeinfo pragma prevents TypeInfo emission.

// RUN: %ldc -output-ll -of=%t.ll %s && FileCheck %s < %t.ll

pragma(LDC_no_moduleinfo); // prevent ModuleInfo from referencing class TypeInfos


// CHECK: _D50TypeInfo_S18pragma_no_typeinfo18StructWithTypeInfo6__initZ = linkonce_odr global %object.TypeInfo_Struct
struct StructWithTypeInfo {}
// force emission
auto ti = typeid(StructWithTypeInfo);

// CHECK: _D18pragma_no_typeinfo17ClassWithTypeInfo7__ClassZ = global %object.TypeInfo_Class
class ClassWithTypeInfo {}

// CHECK: _D18pragma_no_typeinfo21InterfaceWithTypeInfo11__InterfaceZ = global %object.TypeInfo_Class
interface InterfaceWithTypeInfo {}


pragma(LDC_no_typeinfo):

// CHECK-NOT: _D48TypeInfo_S18pragma_no_typeinfo16StructNoTypeInfo6__initZ
struct StructNoTypeInfo {}

// CHECK-NOT: _D18pragma_no_typeinfo15ClassNoTypeInfo7__ClassZ
class ClassNoTypeInfo {}

// CHECK-NOT: _D18pragma_no_typeinfo19InterfaceNoTypeInfo11__InterfaceZ
interface InterfaceNoTypeInfo {}