blob: f5eed44cbb6ed822abc050cace87b4f055fb0684 [file] [log] [blame]
Rafael Espindoladef1b092012-06-14 22:48:13 +00001; RUN: opt < %s -globalopt -S | FileCheck %s
Chris Lattner58601062004-10-07 19:16:26 +00002
Rafael Espindoladef1b092012-06-14 22:48:13 +00003@G1 = internal global i32 123 ; <i32*> [#uses=1]
Rafael Espindola5349d872015-12-22 19:50:22 +00004@A1 = internal alias i32, i32* @G1
Chris Lattner58601062004-10-07 19:16:26 +00005
Rafael Espindoladef1b092012-06-14 22:48:13 +00006; CHECK-NOT: @G1
7; CHECK: @G2
8; CHECK-NOT: @G3
9
Rafael Espindola5349d872015-12-22 19:50:22 +000010; CHECK-NOT: @A1
11
Rafael Espindoladef1b092012-06-14 22:48:13 +000012define void @foo1() {
13; CHECK: define void @foo
14; CHECK-NEXT: ret
15 store i32 1, i32* @G1
Tanya Lattner5640bd12008-03-01 09:15:35 +000016 ret void
Chris Lattner58601062004-10-07 19:16:26 +000017}
Tanya Lattner5640bd12008-03-01 09:15:35 +000018
Rafael Espindoladef1b092012-06-14 22:48:13 +000019@G2 = linkonce_odr constant i32 42
20
21define void @foo2() {
Stephen Lina76289a2013-07-14 01:50:49 +000022; CHECK-LABEL: define void @foo2(
Rafael Espindoladef1b092012-06-14 22:48:13 +000023; CHECK-NEXT: store
24 store i32 1, i32* @G2
25 ret void
26}
27
28@G3 = linkonce_odr constant i32 42