[PATCH] D61845: [builtin] Fixed definitions of builtins that rely on the int/long long type is 32/64 bits
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 14 14:37:06 PDT 2019
efriedma added inline comments.
================
Comment at: test/CodeGen/builtins.cpp:5
+// RUN: %clang_cc1 -std=c++11 -triple powerpc-pc-linux -verify %s
+// RUN: %clang_cc1 -std=c++11 -triple arm-linux-gnueabi -verify %s
+
----------------
You don't need quite so many targets on this list. There are essentially three interesting kinds of targets: targets where int is 16 bits (like avr), targets where int is 32 bits and long is 64 bits (like x86_64 Linux), and targets where int and long are both 32 bits (like i686 Linux).
You might need to pass -ffreestanding to avoid including /usr/include/stdint.h on non-Linux systems.
================
Comment at: test/CodeGen/builtins.cpp:21
+
+uint16_t bswap16; // expected-note{{previous definition is here}}
+decltype(__builtin_bswap16(0)) bswap16 = 42; // expected-error-re{{redefinition of 'bswap16'{{$}}}}
----------------
If you write "extern uint16_t bswap16;", there won't be any error message when the types match.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61845/new/
https://reviews.llvm.org/D61845
More information about the cfe-commits
mailing list