mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
add another case, this one that uses getelementptr instructions
llvm-svn: 23448
This commit is contained in:
parent
6488c9bbc1
commit
0b9e00f69e
@ -1,12 +1,13 @@
|
||||
; RUN: llvm-as < %s | opt -globalopt -disable-output &&
|
||||
; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep CTOR
|
||||
|
||||
%llvm.global_ctors = appending global [6 x { int, void ()* }] [
|
||||
%llvm.global_ctors = appending global [7 x { int, void ()* }] [
|
||||
{ int, void ()* } { int 65535, void ()* %CTOR1 },
|
||||
{ int, void ()* } { int 65535, void ()* %CTOR1 },
|
||||
{ int, void ()* } { int 65535, void ()* %CTOR2 },
|
||||
{ int, void ()* } { int 65535, void ()* %CTOR3 },
|
||||
{ int, void ()* } { int 65535, void ()* %CTOR4 },
|
||||
{ int, void ()* } { int 65535, void ()* %CTOR5 },
|
||||
{ int, void ()* } { int 2147483647, void ()* null }
|
||||
]
|
||||
|
||||
@ -14,6 +15,8 @@
|
||||
%G2 = global int 0
|
||||
%G3 = global int -123
|
||||
|
||||
%X = global {int, [2 x int]} { int 0, [2 x int] [ int 17, int 21] }
|
||||
|
||||
%CTORGV = internal global bool false ;; Should become constant after eval
|
||||
|
||||
implementation
|
||||
@ -48,6 +51,15 @@ internal void %CTOR4() {
|
||||
ret void
|
||||
}
|
||||
|
||||
internal void %CTOR5() {
|
||||
%X.2p = getelementptr {int,[2 x int]}* %X, int 0, uint 1, int 0
|
||||
%X.2 = load int* %X.2p
|
||||
%X.1p = getelementptr {int,[2 x int]}* %X, int 0, uint 0
|
||||
store int %X.2, int* %X.1p
|
||||
store int 42, int* %X.2p
|
||||
ret void
|
||||
}
|
||||
|
||||
bool %accessor() {
|
||||
%V = load bool* %CTORGV ;; constant true
|
||||
ret bool %V
|
||||
|
Loading…
Reference in New Issue
Block a user