mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
33bd6a2d6c
There are situations where inline ASM may want to change the section -- for instance, to create a variable in the .data section. However, it cannot do this without (potentially) restoring to the wrong section. E.g.: asm volatile (".section __DATA, __data\n\t" ".globl _fnord\n\t" "_fnord: .quad 1f\n\t" ".text\n\t" "1:" :::); This may be wrong if this is inlined into a function that has a "section" attribute. The user should use `.pushsection' and `.popsection' here instead. The addition of `.previous' is added for completeness. <rdar://problem/12048387> llvm-svn: 161477
17 lines
342 B
ArmAsm
17 lines
342 B
ArmAsm
// RUN: llvm-mc -triple i386-apple-darwin9 %s -o - | FileCheck %s
|
|
|
|
.text
|
|
// CHECK: .section __TEXT,__text
|
|
|
|
.pushsection __DATA, __data
|
|
// CHECK: .section __DATA,__data
|
|
|
|
.pushsection __TEXT, initcode
|
|
// CHECK: .section __TEXT,initcode
|
|
|
|
.popsection
|
|
// CHECK: .section __DATA,__data
|
|
|
|
.popsection
|
|
// CHECK: .section __TEXT,__text
|