<commit_before>; 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 ()* }] [ 
  { 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 2147483647, void ()* null }
]

%G = global int 0
%G2 = global int 0
%G3 = global int -123

%CTORGV = internal global bool false    ;; Should become constant after eval

implementation

internal void %CTOR1() {   ;; noop ctor, remove.
        ret void
}

internal void %CTOR2() {   ;; evaluate the store
	%A = add int 1, 23
	store int %A, int* %G
	store bool true, bool* %CTORGV
        ret void
}

internal void %CTOR3() {
	%X = or bool true, false
	br label %Cont
Cont:
	br bool %X, label %S, label %T
S:
	store int 24, int* %G2
	ret void
T:
	ret void
}

internal void %CTOR4() {
	%X = load int* %G3
	%Y = add int %X, 123
	store int %Y, int* %G3
	ret void
}

bool %accessor() {
	%V = load bool* %CTORGV   ;; constant true
	ret bool %V
}<commit_msg>add another case, this one that uses getelementptr instructions<commit_after>; RUN: llvm-as < %s | opt -globalopt -disable-output &&
; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep CTOR

%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 }
]

%G = global int 0
%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

internal void %CTOR1() {   ;; noop ctor, remove.
        ret void
}

internal void %CTOR2() {   ;; evaluate the store
	%A = add int 1, 23
	store int %A, int* %G
	store bool true, bool* %CTORGV
        ret void
}

internal void %CTOR3() {
	%X = or bool true, false
	br label %Cont
Cont:
	br bool %X, label %S, label %T
S:
	store int 24, int* %G2
	ret void
T:
	ret void
}

internal void %CTOR4() {
	%X = load int* %G3
	%Y = add int %X, 123
	store int %Y, int* %G3
	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
}
{'fraction_non_alphanumeric': 0.16863289382373353, 'fraction_numerical': 0.05412907702984039, 'mean_word_length': 2.9118046132971505, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3821645', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1130, 'n_words': 416}