[X86] When converting movs to pushes, don't assume MOVmi operand is an actual immediate
[oota-llvm.git] / test / CodeGen / X86 / movtopush.ll
index 6a848b7dc911621699a842965aa048939975e53b..4db1372f9487d922e4123c999f245d6b73c6e88c 100644 (file)
@@ -94,4 +94,19 @@ entry:
   ret void\r
 }\r
 \r
+; Check that pushing the addresses of globals (Or generally, things that \r
+; aren't exactly immediates) isn't broken.\r
+; Fixes PR21878.\r
+; NORMAL-LABEL: test6\r
+; NORMAL: pushl    $_ext\r
+; NORMAL-NEXT: call\r
+declare void @f(i8*)\r
+@ext = external constant i8\r
 \r
+define void @test6() {\r
+  call void @f(i8* @ext)\r
+  br label %bb\r
+bb:\r
+  alloca i32\r
+  ret void\r
+}
\ No newline at end of file