From 30b425860666362c53248803bb9bfa2f018887f8 Mon Sep 17 00:00:00 2001 From: Brian Gesiak Date: Tue, 26 Jan 2016 10:34:34 -0500 Subject: [PATCH] [test] Explicitly sign chars to match expectations `char` is not always signed by default. In fact, the signedness of the `char` datatype in C is undefined. That means that on some architectures, the `c_layout.sil` test fails, because it expects the IR for `char chareth(char a);` to use `signedext`, whereas some architectures treat these types as unsigned, and thus `zeroext` is used. In order to ensure identical signedness on all platforms the tests run on, explicitly specify the signedness using the compiler flag `-fsigned-char`. --- test/IRGen/c_layout.sil | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/IRGen/c_layout.sil b/test/IRGen/c_layout.sil index 24e6b7d4ee9ff..4e136207fc845 100644 --- a/test/IRGen/c_layout.sil +++ b/test/IRGen/c_layout.sil @@ -1,4 +1,4 @@ -// RUN: %target-swift-frontend -I %S/Inputs/abi %s -emit-ir | FileCheck %s --check-prefix=CHECK-%target-cpu +// RUN: %target-swift-frontend -Xcc -fsigned-char -I %S/Inputs/abi %s -emit-ir | FileCheck %s --check-prefix=CHECK-%target-cpu sil_stage canonical import c_layout