brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · ea11b69 Raw
93 lines · plain
1; RUN: llc %s -o - -mtriple=thumbv7-apple-darwin102; RUN: llc %s -o -3 4; REQUIRES: arm-registered-target5 6; NVPTX cannot select BlockAddress7; XFAIL: target=nvptx{{.*}}8 9; The behavior of this test is not well defined. On PowerPC the test may pass10; or fail depending on the order in which the test functions are processed by11; llc.12; UNSUPPORTED: target=powerpc{{.*}}13 14;; Reference to a label that gets deleted.15define ptr @test1() nounwind {16entry:17	ret ptr blockaddress(@test1b, %test_label)18}19 20define i32 @test1b() nounwind {21entry:22	ret i32 -123test_label:24	br label %ret25ret:26	ret i32 -127}28 29 30; Issues with referring to a label that gets RAUW'd later.31define i32 @test2a() nounwind {32entry:33        %target = bitcast ptr blockaddress(@test2b, %test_label) to ptr34 35        call i32 @test2b(ptr %target)36 37        ret i32 038}39 40define i32 @test2b(ptr %target) nounwind {41entry:42        indirectbr ptr %target, [label %test_label]43 44test_label:45; assume some code here...46        br label %ret47 48ret:49        ret i32 -150}51 52; Issues with a BB that gets RAUW'd to another one after references are53; generated.54define void @test3(ptr %P, ptr %Q) nounwind {55entry:56  store ptr blockaddress(@test3b, %test_label), ptr %P57  store ptr blockaddress(@test3b, %ret), ptr %Q58  ret void59}60 61define i32 @test3b() nounwind {62entry:63	br label %test_label64test_label:65	br label %ret66ret:67	ret i32 -168}69 70 71; PR667372 73define i64 @test4a() {74	%target = bitcast ptr blockaddress(@test4b, %usermain) to ptr75	%ret = call i64 @test4b(ptr %target)76 77	ret i64 %ret78}79 80define i64 @test4b(ptr %Code) {81entry:82	indirectbr ptr %Code, [label %usermain]83usermain:84	br label %label_line_085 86label_line_0:87	br label %label_line_188 89label_line_1:90	%target = ptrtoint ptr blockaddress(@test4b, %label_line_0) to i6491	ret i64 %target92}93