about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-11-24 01:31:56 +0800
committerGitHub <noreply@github.com>2018-11-24 01:31:56 +0800
commite0025df3fdfa8be82946a6e861049bae932eba75 (patch)
treee67262c792f3aa23e2a183f52098982e2bdc42c5 /src/test/codegen
parentfb33fa49160f666d1cad0af6c275e15cf523e047 (diff)
parent4c21f66c1dffefa0dbeec3e409aa77630cb9a448 (diff)
downloadrust-e0025df3fdfa8be82946a6e861049bae932eba75.tar.gz
rust-e0025df3fdfa8be82946a6e861049bae932eba75.zip
Rollup merge of #56097 - ogoffart:union-abi, r=eddyb
Fix invalid bitcast taking bool out of a union represented as a scalar

As reported in https://github.com/rust-lang/rust/pull/54668#issuecomment-440186476
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/union-abi.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/codegen/union-abi.rs b/src/test/codegen/union-abi.rs
index 786968128ec..5a6df52502e 100644
--- a/src/test/codegen/union-abi.rs
+++ b/src/test/codegen/union-abi.rs
@@ -78,3 +78,9 @@ pub union CUnionU128{a:u128}
 #[no_mangle]
 pub fn test_CUnionU128(_: CUnionU128) { loop {} }
 
+pub union UnionBool { b:bool }
+// CHECK: define zeroext i1 @test_UnionBool(i8 %b)
+#[no_mangle]
+pub fn test_UnionBool(b: UnionBool) -> bool { unsafe { b.b }  }
+// CHECK: %0 = trunc i8 %b to i1
+