File: tricky-names.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (41 lines) | stat: -rw-r--r-- 1,975 bytes parent folder | download | duplicates (7)
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
30
31
32
33
34
35
36
37
38
39
40
41
; Check how tricky symbols are printed in the asm output.
; RUN: llc -mtriple=i686-pc-win32 %s -o - | FileCheck %s --check-prefix=ASM
; RUN: llc -mtriple=i686-pc-win32 %s -x86-asm-syntax=intel -o - | FileCheck %s --check-prefix=ASM

; Check that we can roundtrip these names through our assembler,
; in both at&t and intel syntax.
; RUN: llc -mtriple=i686-pc-win32 %s -o - | llvm-mc -triple i686-pc-win32 -filetype=obj | llvm-readobj --symbols - | FileCheck %s --check-prefix=READOBJ
; RUN: llc -mtriple=i686-pc-win32 -x86-asm-syntax=intel %s -o - | llvm-mc -triple i686-pc-win32 -filetype=obj | llvm-readobj --symbols - | FileCheck %s --check-prefix=READOBJ


@"\01??__E_Generic_object@?$_Error_objects@H@std@@YAXXZ" = global i32 0
@"\01__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4" = global i32 0
@"\01@foo.bar" = global i32 0

define weak i32 @"\01??_B?$num_put@_WV?$back_insert_iterator@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@std@@@std@@51"() section ".text" {
  %a = load i32, i32* @"\01??__E_Generic_object@?$_Error_objects@H@std@@YAXXZ"
  %b = load i32, i32* @"\01__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4"
  %c = load i32, i32* @"\01@foo.bar"
  %x = add i32 %a, %b
  %y = add i32 %x, %c
  ret i32 %y
}

; Check that these symbols are not quoted. They occur in output that gets passed to GAS.
; ASM: .globl __ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4
; ASM-NOT: .globl "__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4"
; ASM: .globl @foo.bar
; ASM-NOT: .globl "@foo.bar"

; READOBJ: Symbol
; READOBJ: Name: .text
; READOBJ: Section: .text
; READOBJ: Symbol
; READOBJ: Name: ??_B?$num_put@_WV?$back_insert_iterator@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@std@@@std@@51
; READOBJ: Section: .text
; READOBJ: Symbol
; READOBJ: Name: ??__E_Generic_object@?$_Error_objects@H@std@@YAXXZ
; READOBJ: Symbol
; READOBJ: Name: __ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4
; READOBJ: Symbol
; READOBJ: Name: @foo.bar