Files
clang-p2996/clang/test/Sema/thread_local.c
Sean Perry c9ab1d8905 Mark test cases as unsupported on z/OS (#90990)
These test cases are testing features not available when either
targeting the s390x-ibm-zos target or use tools/features not available
on the z/OS operating system. In a couple cases the lit test had a
number of subtests with one or two that aren't supported on z/OS. Rather
than mark the entire test as unsupported I split out the unsupported
tests into a separate test case.
2024-05-07 15:23:50 -04:00

21 lines
796 B
C

// RUN: %clang_cc1 -fsyntax-only -std=c23 %s -verify
// UNSUPPORTED: target={{.*}}-zos{{.*}}
// Ensure that thread_local and _Thread_local are synonyms in C23 and both
// restrict local variables to be explicitly static or extern.
void func(void) {
// FIXME: it would be nice if the diagnostic said 'thread_local' in this case.
thread_local int i = 12; // expected-error {{'_Thread_local' variables must have global storage}}
_Thread_local int j = 13; // expected-error {{'_Thread_local' variables must have global storage}}
static thread_local int k = 14;
static _Thread_local int l = 15;
extern thread_local int m;
extern thread_local int n;
}
// This would previously fail because the tls models were different.
extern thread_local unsigned a;
_Thread_local unsigned a = 0;