https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118828
Bug ID: 118828
Summary: LoongArch: #pragma GCC target should update
__loongarch_asx and similar macros
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: xry111 at gcc dot gnu.org
Target Milestone: ---
Test case:
/* { dg-do preprocess } */
/* { dg-options "-mno-lasx" } */
#ifdef __loongarch_asx
#error LASX shouldn't be available here
#endif
#pragma GCC push_options
#pragma GCC target("lasx")
#ifndef __loongarch_asx
#error LASX should be available here
#endif
#pragma GCC pop_options
#ifdef __loongarch_asx
#error LASX should become unavailable again
#endif
Note that a similar test case (c-c++-common/pragma-target-2.c) for x86 works as
expected.