blob: 49abd8a92e6486d2513c55726e1dea16dad5c144 [file] [log] [blame]
Chris Lattner5099b312010-01-03 18:09:40 +00001; RUN: llc %s -o - | grep {__TEXT,__const}
Chris Lattner2ef90d72010-01-03 18:10:58 +00002; PR5929
Chris Lattner5099b312010-01-03 18:09:40 +00003target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
4target triple = "i386-apple-darwin10.0"
5
6; This array should go into the __TEXT,__const section, not into the
7; __DATA,__const section, because the elements don't need relocations.
Rafael Espindola1c10db32011-01-16 18:02:57 +00008@test.array = internal unnamed_addr constant [3 x i32] [i32 sub (i32 ptrtoint (i8* blockaddress(@test, %foo) to i32), i32 ptrtoint (i8* blockaddress(@test, %foo) to i32)), i32 sub (i32 ptrtoint (i8* blockaddress(@test, %bar) to i32), i32 ptrtoint (i8* blockaddress(@test, %foo) to i32)), i32 sub (i32 ptrtoint (i8* blockaddress(@test, %hack) to i32), i32 ptrtoint (i8* blockaddress(@test, %foo) to i32))] ; <[3 x i32]*> [#uses=1]
Chris Lattner5099b312010-01-03 18:09:40 +00009
10define void @test(i32 %i) nounwind ssp {
11entry:
Chris Lattner37914c82010-02-15 20:47:49 +000012 call void @test(i32 1)
Chris Lattner5099b312010-01-03 18:09:40 +000013 br label %foo
14
Chris Lattner37914c82010-02-15 20:47:49 +000015foo:
16 call void @test(i32 1)
Chris Lattner5099b312010-01-03 18:09:40 +000017 br label %bar
18
Chris Lattner37914c82010-02-15 20:47:49 +000019bar:
20 call void @test(i32 1)
Chris Lattner5099b312010-01-03 18:09:40 +000021 br label %hack
22
Chris Lattner37914c82010-02-15 20:47:49 +000023hack:
24 call void @test(i32 1)
Chris Lattner5099b312010-01-03 18:09:40 +000025 ret void
26}