mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 13:50:11 +00:00
729379a1e1
Move the logic for determining the `wchar_t` type information into the driver. Rather than passing the single bit of information of `-fshort-wchar` indicate to the frontend the desired type of `wchar_t` through a new `-cc1` option of `-fwchar-type` and indicate the signedness through `-f{,no-}signed-wchar`. This replicates the current logic which was spread throughout Basic into the `RenderCharacterOptions`. Most of the changes to the tests are to ensure that the frontend uses the correct type. Add a new test set under `test/Driver/wchar_t.c` to ensure that we calculate the proper types for the various cases. llvm-svn: 315126
11 lines
375 B
C++
11 lines
375 B
C++
// RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify %s
|
|
// RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify -fwchar-type=short -fno-signed-wchar %s
|
|
// expected-no-diagnostics
|
|
|
|
#include <stdint.h>
|
|
|
|
const bool swchar = (wchar_t)-1 > (wchar_t)0;
|
|
|
|
int max_test[WCHAR_MAX == (swchar ? -(WCHAR_MIN+1) : (wchar_t)-1)];
|
|
int min_test[WCHAR_MIN == (swchar ? 0 : -WCHAR_MAX-1)];
|