File: odr_comdat.ll

package info (click to toggle)
llvm-3.1 3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 80,224 kB
  • sloc: cpp: 491,014; asm: 110,971; ansic: 14,579; sh: 13,120; python: 6,152; ml: 4,719; makefile: 1,830; pascal: 1,553; perl: 874; xml: 283; lisp: 187; csh: 117; exp: 4
file content (16 lines) | stat: -rw-r--r-- 870 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; RUN: llc < %s -mtriple=arm-linux-gnueabi | FileCheck %s -check-prefix=ARMGNUEABI

; Checking that a comdat group gets generated correctly for a static member 
; of instantiated C++ templates.
; see http://sourcery.mentor.com/public/cxx-abi/abi.html#vague-itemplate
; section 5.2.6 Instantiated templates
; "Any static member data object is emitted in a COMDAT identified by its mangled 
;  name, in any object file with a reference to its name symbol."

; Case 1: variable is not explicitly initialized, and ends up in a .bss section
; ARMGNUEABI: .section        .bss._ZN1CIiE1iE,"aGw",%nobits,_ZN1CIiE1iE,comdat
@_ZN1CIiE1iE = weak_odr global i32 0, align 4

; Case 2: variable is explicitly initialized, and ends up in a .data section
; ARMGNUEABI: .section        .data._ZN1CIiE1jE,"aGw",%progbits,_ZN1CIiE1jE,comdat
@_ZN1CIiE1jE = weak_odr global i32 12, align 4