file
stringlengths
18
26
data
stringlengths
3
1.04M
the_stack_data/190769076.c
/* Copyright (c) 2014, Alexey Frunze 2-clause BSD license. */ int strcmp(char* s1, char* s2) { #ifdef __SMALLER_C_16__ asm("mov di, [bp+6]\n" "mov si, di\n" "mov cx, -1\n" "xor ax, ax\n" "mov bx, ax\n" "cld\n" "repnz scasb\n" "not cx"); asm("mov di, [bp+4]\n" "repe cmpsb\n" "mov al, [di-1]\n" "mov bl, [si-1]\n" "sub ax, bx"); #else while (*s1 == *s2) { if (!*s1) return 0; ++s1; ++s2; } return ((unsigned char)*s1) - ((unsigned char)*s2); #endif }
the_stack_data/234517475.c
#include <stdlib.h> #include <stdio.h> typedef int key_t; typedef int object_t; typedef struct hp_n_t { int rank; key_t key; object_t* object; struct hp_n_t* left; struct hp_n_t* right; } heap_node_t; typedef heap_node_t node_t; // _____________________________________________________________________________ #define BLOCKSIZE 256 node_t* currentblock = NULL; int size_left; node_t* free_list = NULL; node_t* get_node() { node_t* tmp; if ( free_list != NULL ) { tmp = free_list; free_list = free_list -> left; } else { if ( currentblock == NULL || size_left == 0) { currentblock = (node_t*) malloc( BLOCKSIZE * sizeof(node_t) ); size_left = BLOCKSIZE; } tmp = currentblock++; size_left -= 1; } return ( tmp ); } void return_node(node_t* node) { node->left = free_list; free_list = node; } heap_node_t* create_heap(void) { heap_node_t* tmp_node; tmp_node = get_node(); tmp_node->rank = 0; return ( tmp_node ); } int heap_empty(heap_node_t* hp) { return ( hp->rank == 0 ); } key_t find_min_key(heap_node_t* hp) { return ( hp->key ); } object_t* find_min_object(heap_node_t* hp) { return ( hp->object ); } void remove_heap(heap_node_t* hp) { heap_node_t* current_node, *tmp; if ( hp->rank == 0) { return_node( hp ); } else { current_node = hp; while (current_node != NULL ) { if ( current_node->left == NULL ) { tmp = current_node->right; return_node( current_node ); current_node = tmp; } else { tmp = current_node; current_node = current_node->left; tmp->left = current_node->right; current_node->right = tmp; } } } } int insert(key_t new_key, object_t* new_obj, heap_node_t* hp) { if (hp->rank == 0) { /* insert in empty heap */ hp->object = new_obj; hp->key = new_key; hp->left = hp->right = NULL; hp->rank = 1; } else if ( new_key < hp->key ) { /* new minimum, replace root */ heap_node_t* tmp; tmp = get_node(); tmp->left = hp->left; tmp->right = hp->right; tmp->key = hp->key; tmp->rank = hp->rank; tmp->object = hp->object; hp->left = tmp; hp->right = NULL; hp->key = new_key; hp->object = new_obj; hp->rank = 1; } else { /* normal insert */ heap_node_t* tmp, *tmp2, *new_node; heap_node_t* node_stack[100]; int stack_p = 0; tmp = hp; /* go down right path to the insertion point */ while ( tmp->right != NULL && tmp->right->key < new_key) { node_stack[stack_p++] = tmp ; tmp = tmp->right; } /* now create new node */ new_node = get_node(); new_node->key = new_key; new_node->object = new_obj; /* insert new node in path, everything below goes left */ new_node->left = tmp->right; new_node->right = NULL; new_node->rank = 1; if ( tmp->left == NULL ) /* possible only at the end */ { tmp->left = new_node; } /* here tmp->right == NULL */ else { /* insert right, restore leftist property */ tmp->right = new_node; tmp->rank = 2; /* has rank at least one also left */ /* completed insert, now move up, recompute rank and exchange left and right where necessary */ while ( stack_p > 0 ) { tmp = node_stack[--stack_p]; { if (tmp->left->rank < tmp->right->rank ) { tmp2 = tmp->left; tmp->left = tmp->right; tmp->right = tmp2; } tmp->rank = tmp->right->rank + 1; } } } /* end walking back to the root */ } return (0); } heap_node_t* merge(heap_node_t* hp1, heap_node_t* hp2) { heap_node_t* root, *tmp1, *tmp2, *tmp3; heap_node_t* node_stack[100]; int stack_p = 0; printf(" >merge: started \n"); if ( hp1->rank == 0 ) { /* heap 1 empty */ return_node( hp1 ); return ( hp2 ); } if ( hp2->rank == 0 ) { /* heap 2 empty */ return_node( hp2 ); return ( hp1 ); } /* select new root, setup merging */ if ( hp1->key < hp2->key ) { tmp1 = root = hp1; tmp2 = hp1->right; tmp3 = hp2; } else { tmp1 = root = hp2; tmp2 = hp2->right; tmp3 = hp1; } while ( tmp2 != NULL && tmp3 != NULL ) { if ( tmp2->key < tmp3->key ) { tmp1->right = tmp2; node_stack[stack_p++] = tmp1 ; tmp1 = tmp2; tmp2 = tmp2->right; } else { tmp1->right = tmp3; node_stack[stack_p++] = tmp1 ; tmp1 = tmp3; tmp3 = tmp3->right; } } if ( tmp2 == NULL) { tmp1->right = tmp3; } else { tmp1->right = tmp2; } /* merging of right paths complete, now recompute rank */ /* and restore leftist property */ node_stack[stack_p++] = tmp1 ; while ( stack_p > 0 ) { tmp1 = node_stack[--stack_p]; if ( tmp1->left == NULL || (tmp1->left != NULL && tmp1->right != NULL && tmp1->left->rank < tmp1->right->rank ) ) { tmp2 = tmp1->left; tmp1->left = tmp1->right; tmp1->right = tmp2; } if ( tmp1->right == NULL ) { tmp1->rank = 1; } else { tmp1->rank = tmp1->right->rank + 1; } } return ( root ); } object_t* delete_min(heap_node_t* hp) { object_t* del_obj; heap_node_t* heap1, *heap2, *tmp; del_obj = hp->object; heap1 = hp->left; heap2 = hp->right; if ( heap1 == NULL && heap2 == NULL ) { hp->rank = 0; } else { if ( heap2 == NULL ) { tmp = heap1; } else { tmp = merge( heap1, heap2); } /* now they are merged, need to copy root to correct place*/ hp->key = tmp->key; hp->object = tmp->object; hp->rank = tmp->rank; hp->left = tmp->left; hp->right = tmp->right; return_node( tmp ); } return ( del_obj ); } // _____________________________________________________________________________ // Sample test int main() { heap_node_t* heap; char nextop; heap = create_heap(); printf("Made Heap\n"); while ( (nextop = getchar()) != 'q' ) { if ( nextop == 'i' ) { int inskey, *insobj, success; insobj = (object_t*) malloc(sizeof(object_t)); scanf(" %d,%d", &inskey, insobj); success = insert( inskey, insobj, heap ); if ( success == 0 ) printf(" insert successful, key = %d, object value = %d, \ current heap rank is %d\n", inskey, *insobj, heap->rank ); else { printf(" insert failed, success = %d\n", success); } } if ( nextop == 'd' ) { object_t* delobj; getchar(); delobj = delete_min( heap); if ( delobj == NULL ) { printf(" delete failed\n"); } else printf(" delete successful, deleted object %d, current heap rank is %d\n", *delobj, heap->rank ); } if ( nextop == '?' ) { heap_node_t* tmp; getchar(); tmp = heap; printf(" left path: key values "); while ( tmp != NULL ) { printf(" %d,", tmp->key); tmp = tmp->left; } printf("\n"); tmp = heap; printf(" right path: key values "); while ( tmp != NULL ) { printf(" %d,", tmp->key); tmp = tmp->right; } printf("\n"); } } return (0); }
the_stack_data/1097606.c
#include <stdio.h> int main() { int a, b; scanf("%d",&a); scanf("%d", &b); printf("%d %d\n", a*b, 2*(a+b)); return 0; }
the_stack_data/145452507.c
#include <stdio.h> int main() { int m,n,i,p,q; scanf("%d %d",&m,&n); double s=1.0; for(i=1;i<=n;i++) { p=m-i+1; q=n-i+1; s*=((double)p/(double)q); } printf("%.0f",s); return 0; }
the_stack_data/139566.c
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdint.h> typedef struct { double *array; } Vector; uint32_t round2(uint32_t input, int n) { uint32_t mask = 0; mask = ~mask << n; return input & mask; } union { float f; unsigned int u; } p; int main() { // uint32_t input = 31; // int n = 2; // uint32_t r = round2(input, n); // printf("%d\n", r); // // Vector *v = malloc(sizeof(Vector)); // v->array = malloc(5*sizeof(double)); // v->array[0] = 1.2; // printf("%f\n", v->array[0]); p.f = 17.5; unsigned int sign = (p.u >> 31) & 1; unsigned int exp = (p.u >> 23) & 0xff; unsigned int coef_mask = (1 << 23) - 1; unsigned int coef = p.u & coef_mask; printf("%d\n", sign); printf("%d\n", exp); printf("0x%x\n", coef); return 0; }
the_stack_data/16791.c
/* 统计单词 */ #include <stdio.h> #include <string.h> const int MAX = 100; int main(void) { char word[MAX]; // while (scanf("%s", word) != ' ' || scanf("%s", word) != '\n') while (scanf("%s", word) != EOF) { int len = strlen(word); if (word[len - 1] == '.') { printf("%d", len - 1); } else { printf("%d ", len); } } return 0; }
the_stack_data/32950095.c
/*----------------------------------------------------------------------* * File: gaia.c * * * * Purpose: Simulate a 2-D cellular automata model "DEAsy-World". * * * * * * Author: Ben Tatman * * University of Cambridge * * [email protected] * * * * License: Copyright 2017-2018 Ben Tatman * * Permission is hereby granted, free of charge, to any person * * obtaining a copy of this software and associated documentation files * * (the "Software"), to deal in the Software without restriction, * * including without limitation the rights to use, copy, modify, merge, * * publish, distribute, sublicense, and/or sell copies of the Software, * * and to permit persons to whom the Software is furnished to do so, * * subject to the following conditions: * * * * The above copyright notice and this permission notice shall be * * included in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * * SOFTWARE. * * * * History: 20-Dec-2017, version 1.0 * *----------------------------------------------------------------------*/ extern int diploid; extern int sexual; extern int sim_length; extern char output_folder[500]; extern float radiation_intensity; extern float global_temperature; extern int resources_for_reproducing; extern int initial_mutation_rate; extern float initial_colour; extern float initial_t_opt; extern int initial_dispersal; extern int initial_progeny; extern int initial_pop; extern int verbose; extern int verbose_s; extern int cheat; extern int goldschmidt; extern int goldschmidt_freq; extern int cheat_freq; extern int runprint; extern float dominance; extern float sex_freq; extern int peak_verb; extern float oscillation_wavelength; extern int edea; /*----------------------------------------------------------------------* * Function: get_arg * * Purpose: Extracts value of argument * * Params: c = pointer to string * * start = start position of value * * Returns: value as a float * *----------------------------------------------------------------------*/ float get_arg(char * c, int start) { int i; char str[256] = ""; for (i = start; i < strlen(c); i++) { str[i-start] = c[i]; } return atof(str); } /*----------------------------------------------------------------------* * Function: parse_settings * * Purpose: Parses command line options and sets values. * * Params: argc = number of arguments * * argv = array of arguments * * Returns: 1 if successful, -1 if failed. * *----------------------------------------------------------------------*/ int parse_settings(int argc, char*argv[]) { int i; for (i = 1; i < argc; i++) { switch (argv[i][0]) { case 'd': diploid = 1; break; case 'h': diploid = 0; break; case 's': sexual = 1; break; case 'e': edea = 1; break; // case 'm': dominance = (float) get_arg(argv[i], 1); break; // case 'a': sexual = 0; break; case 'c': cheat = 1; cheat_freq = (int) get_arg(argv[i], 1); break; case 'l': sim_length = (int) get_arg(argv[i], 1); break; case 'v': verbose = 1; verbose_s = (int) get_arg(argv[i], 1); break; // case 'u': runprint = 0; break; // case 'b': peak_verb = 1; break; case 'o': switch (argv[i][1]) { case 's': sex_freq = (float) get_arg(argv[i], 2); break; default: if (i < argc - 1) { strcpy(output_folder, argv[i+1]); i++; } else { printf("Please provide a folder name."); } break; } break; case 't': global_temperature = get_arg(argv[i], 1); break; case 'r': resources_for_reproducing = (int) get_arg(argv[i], 1); break; case 'k': radiation_intensity = get_arg(argv[i], 1); break; case 'g': goldschmidt = 1; goldschmidt_freq = (int) get_arg(argv[i], 1); break; case 'f': oscillation_wavelength = get_arg(argv[i], 1); break; case 'i': switch (argv[i][1]) { case 'm': initial_mutation_rate = (int) (get_arg(argv[i], 2) * 1000); break; case 'c': initial_colour = get_arg(argv[i], 2); break; case 't': initial_t_opt = get_arg(argv[i], 2); break; case 'd': initial_dispersal = (int) get_arg(argv[i], 2); break; case 'p': initial_pop = (int) get_arg(argv[i], 2); break; case 'k': initial_progeny = (int) get_arg(argv[i], 2); break; default: break; } break; case '!': printf("Welcome to Gaia, a Daisyworld simulation program.\ncNUMBER - mate individuals across the map to simulate human intervention. Number is times in 10,000. \ngNUMBER - introduce goldschmidt macromutations. Number is frequency in 10,000.\nd - create diploid daisies (DEFAULT)\nh - create haploid daisies\ne - activate EDEA\nmNUMBER - set dominance coefficient (DEFAULT = 0.5)\nvNUMBER - enable verbose mode, print detailed map every NUMBER times\nu - disable output\ns - create sexual daisies (DEFAULT)\na - create asexual daisies\nlNUMBER - set number of timesteps to run (DEFAULT = 6000)\noFOLDER - set output folder (DEFAULT = .)\ntNUMBER - set initial temperature\nrNUMBER - set resources needed to reproduce (DEFAULT = 30)\nkNUMBER - set radiation intensity (DEFAULT = 1.0)\nimNUMBER - set initial mutation rate (DEFAULT 0.05)\nicNUMBER - set initial colour (DEFAULT 0.5)\nitNUMBER - set initial optimum temperature\nidNUMBER - set initial dispersal (DEFAULT 3)\nikNUMBER - set initial number of progeny (DEFAULT 2)\nipNUMBER - set initial population (DEFAULT 10)\n"); return -1; break; default: break; } } //printf("%d\n", 1+ atoi(argv[1])); if (sexual == 1 && diploid == 0) { printf("Can't have sexual haploids.\n"); return -1; } return 1; }
the_stack_data/34511724.c
/* { dg-do compile } */ /* { dg-options "-O2" } */ #include <string.h> int __attribute__ ((cold)) t(int c) { return c * 11; } /* { dg-final { scan-assembler "imul" } } */
the_stack_data/17419.c
// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%h.%t-%h.profraw_%h %run %t // RUN: %run uname -n > %t.n // RUN: llvm-profdata merge -o %t.profdata `cat %t.n`.%t-`cat %t.n`.profraw_`cat %t.n` // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s // REQUIRES: shell int main(int argc, const char *argv[]) { // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (argc > 2) return 1; return 0; } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2}
the_stack_data/247019268.c
#include <stdio.h> int main() { int c, nc = 0, nl = 0, nw = 0; while ( (c = getchar()) != EOF ) { nc++; if (c == '\n') nl++; if (c == ' ') nw++; } printf("Number of characters = %d over %d words, number of lines = %d\n", nc, nw, nl); return 0; }
the_stack_data/25564.c
/* * OpenSplice DDS * * This software and documentation are Copyright 2006 to TO_YEAR PrismTech * Limited, its affiliated companies and licensors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ char *predefs[] = { #ifdef AOSVS "AOSVS", #endif #ifdef DATAGENERAL "DATAGENERAL", #endif #ifdef DGUX "DGUX", #endif #ifdef MPU6502 "MPU6502", #endif #ifdef MPU68000 "MPU68000", #endif #ifdef MPU80186 "MPU80186", #endif #ifdef MPU8080 "MPU8080", #endif #ifdef MPU8086 "MPU8086", #endif #ifdef MPUZ80 "MPUZ80", #endif #ifdef ON_SEL "ON_SEL", #endif #ifdef PDP11 "PDP11", #endif #ifdef PWB "PWB", #endif #ifdef RES "RES", #endif #ifdef RT "RT", #endif #ifdef TM_DPS6 "TM_DPS6", #endif #ifdef TM_L66 "TM_L66", #endif #ifdef TS "TS", #endif #ifdef TS_GCOS "TS_GCOS", #endif #ifdef TS_MOD400 "TS_MOD400", #endif #ifdef aosvs "aosvs", #endif #ifdef cpm "cpm", #endif #ifdef datageneral "datageneral", #endif #ifdef decus "decus", #endif #ifdef dgux "dgux", #endif #ifdef dm80286 "dm80286", #endif #ifdef dm80386 "dm80386", #endif #ifdef dm8088 "dm8088", #endif #ifdef gcos "gcos", #endif #ifdef ghs "ghs", #endif #ifdef hp9000s200 "hp9000s200", #endif #ifdef hp9000s500 "hp9000s500", #endif #ifdef i80286 "i80286", #endif #ifdef i80386 "i80386", #endif #ifdef i8088 "i8088", #endif #ifdef ibm "ibm", #endif #ifdef ibm032 "ibm032", #endif #ifdef interdata "interdata", #endif #ifdef kl10 "kl10", #endif #ifdef lint "lint", #endif #ifdef lm80286 "lm80286", #endif #ifdef lm80386 "lm80386", #endif #ifdef lm8088 "lm8088", #endif #ifdef m68000 "m68000", #endif #ifdef m68k "m68k", #endif #ifdef mc68000 "mc68000", #endif #ifdef mert "mert", #endif #ifdef n16 "n16", #endif #ifdef nomacarg "nomacarg", #endif #ifdef ns16000 "ns16000", #endif #ifdef ns32000 "ns32000", #endif #ifdef orion "orion", #endif #ifdef os "os", #endif #ifdef pdp11 "pdp11", #endif #ifdef pm80286 "pm80286", #endif #ifdef pm80386 "pm80386", #endif #ifdef pm8088 "pm8088", #endif #ifdef rsx "rsx", #endif #ifdef sel "sel", #endif #ifdef selport "selport", #endif #ifdef sm80286 "sm80286", #endif #ifdef sm80386 "sm80386", #endif #ifdef sm8088 "sm8088", #endif #ifdef sun "sun", #endif #ifdef tops20 "tops20", #endif #ifdef tss "tss", #endif #ifdef u370 "u370", #endif #ifdef u3b "u3b", #endif #ifdef u3b2 "u3b2", #endif #ifdef u3b5 "u3b5", #endif #ifdef univac "univac", #endif #ifdef unix "unix", #endif #ifdef vax "vax", #endif #ifdef vaxc "vaxc", #endif /* whether to leave these next two in was a tough call... */ #ifdef __GNU__ "__GNU__", #endif #ifdef __GNUC__ "__GNUC__", #endif #ifdef NeXT "NeXT", #endif #ifdef __MACH__ "__MACH__", #endif 0 };
the_stack_data/181394268.c
/* * Program to learn about passing structures to functions and how pointers * to structures work */ #include <stdio.h> struct complex { int re; int im; }; void add1real_not_update (struct complex c) // by default, parameters are passed // by value { c.re += 1; printf("%i + %ij\n", c.re, c.im); } void add1real_and_update (struct complex *c) // use pointers to pass parameters // by reference { c->re += 1; //(*c).re += 1; printf("%i + %ij\n", c->re, c->im); //printf("%i + %ij\n", (*c).re, (*c).im); } int main() { struct complex c1 = {2,1}; add1real_not_update(c1); printf("%i + %ij\n", c1.re, c1.im); add1real_and_update(&c1); printf("%i + %ij\n", c1.re, c1.im); return 0; }
the_stack_data/1032933.c
/* Copyright (C) 1999-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <sys/timex.h> #ifndef MOD_OFFSET # define modes mode #endif int ntp_gettimex (struct ntptimeval *ntv) { struct timex tntx; int result; tntx.modes = 0; result = __adjtimex (&tntx); ntv->time = tntx.time; ntv->maxerror = tntx.maxerror; ntv->esterror = tntx.esterror; ntv->tai = tntx.tai; ntv->__glibc_reserved1 = 0; ntv->__glibc_reserved2 = 0; ntv->__glibc_reserved3 = 0; ntv->__glibc_reserved4 = 0; return result; }
the_stack_data/178264741.c
// // main.c // AoC // // Created by Matteo Negro on 02/12/20. // #include <stdio.h> #include <stdlib.h> #include <string.h> #define NOMEFILE "/Users/matteoblack/Desktop/AoC/AoC_2/AoC/AoC/input.txt" #define LUNGHEZZA 100 //Funz DAY2_1, legge quante volte compare una lettera int DAY2_1(FILE* pFileElab); //Funz DAY2_2, legge se la lettera compare una volat nelle pos int DAY2_2(FILE* pFileElab); int main() { int result; FILE* pFile; pFile = NULL; result = DAY2_2(pFile); printf("\nIl num di pwd è: %d\n", result); return 0; } int DAY2_1(FILE* pFileElab){ int counterPwd; int countChar; int c; int min; int max; char campione; char pwd[LUNGHEZZA]; counterPwd = 0; pFileElab = fopen(NOMEFILE, "r"); if(pFileElab == NULL){ printf("Errore in APERTURA"); }else{ //Fai lettura !!vincolata!! alla formattazione del file... while((fscanf(pFileElab, "%d-%d %c: %s", &min, &max, &campione, pwd))!=EOF){ c = 0; countChar = 0; while(pwd[c]!='\0'){ if(pwd[c]==campione){ countChar++; } c++; } if((countChar<=max)&&(countChar>=min)){ counterPwd++; } } } fclose(pFileElab); return counterPwd; } int DAY2_2(FILE* pFileElab){ int counterPwd; int c; int pos_1; int pos_2; int valid; char campione; char pwd[LUNGHEZZA]; counterPwd = 0; pFileElab = fopen(NOMEFILE, "r"); if(pFileElab == NULL){ printf("Errore in APERTURA"); }else{ //Fai lettura vincolata alla formattazione del file... while((fscanf(pFileElab, "%d-%d %c: %s", &pos_1, &pos_2, &campione, pwd))!=EOF){ c = 0; valid = 0; pos_1--; pos_2--; while(pwd[c]!='\0'){ if((c==pos_1)||(c==pos_2)){ if(pwd[c]==campione){ valid++; } } c++; } if(valid==1){ counterPwd++; } } } fclose(pFileElab); return counterPwd; }
the_stack_data/45450332.c
int main(){ unsigned int x = 0; unsigned int y = 0; while(x < 2){ x++; y++; if(x != y){ ERROR: return 1; } } return 0; }
the_stack_data/161080828.c
/** * Kostra programu pro 3. projekt IZP 2017/18 * * Jednoducha shlukova analyza * Unweighted pair-group average * https://is.muni.cz/th/172767/fi_b/5739129/web/web/usrov.html */ #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <math.h> // sqrtf #include <limits.h> // INT_MAX // Redefine EXIT MACROS #undef EXIT_FAILURE #undef EXIT_SUCCESS #define EXIT_FAILURE -1 #define EXIT_SUCCESS 1 // Define error messages #define ERROR_BASE "Error: " #define ERROR_BAD_FILE ERROR_BASE "File does not exist, is not readable, damaged or badly formatted.\n" #define ERROR_BAD_ARGUMENTS ERROR_BASE "Arguments are badly formatted or missing.\n" #define ERROR_ITEMS ERROR_BASE "Less items than expected or badly formatted.\n" #define ERROR_UNIQUE_IDS ERROR_BASE "Item IDs are not unique.\n" /***************************************************************** * Ladici makra. Vypnout jejich efekt lze definici makra * NDEBUG, napr.: * a) pri prekladu argumentem prekladaci -DNDEBUG * b) v souboru (na radek pred #include <assert.h> * #define NDEBUG */ #ifdef NDEBUG #define debug(s) #define dfmt(s, ...) #define dint(i) #define dfloat(f) #else // vypise ladici retezec #define debug(s) printf("- %s\n", s) // vypise formatovany ladici vystup - pouziti podobne jako printf #define dfmt(s, ...) printf(" - "__FILE__":%u: "s"\n",__LINE__,__VA_ARGS__) // vypise ladici informaci o promenne - pouziti dint(identifikator_promenne) #define dint(i) printf(" - " __FILE__ ":%u: " #i " = %d\n", __LINE__, i) // vypise ladici informaci o promenne typu float - pouziti // dfloat(identifikator_promenne) #define dfloat(f) printf(" - " __FILE__ ":%u: " #f " = %g\n", __LINE__, f) #endif /***************************************************************** * Deklarace potrebnych datovych typu: * * TYTO DEKLARACE NEMENTE * * struct obj_t - struktura objektu: identifikator a souradnice * struct cluster_t - shluk objektu: * pocet objektu ve shluku, * kapacita shluku (pocet objektu, pro ktere je rezervovano * misto v poli), * ukazatel na pole shluku. */ struct obj_t { int id; float x; float y; }; struct cluster_t { int size; int capacity; struct obj_t *obj; }; /***************************************************************** * Deklarace potrebnych funkci. * * PROTOTYPY FUNKCI NEMENTE * * IMPLEMENTUJTE POUZE FUNKCE NA MISTECH OZNACENYCH 'TODO' * */ /* Inicializace shluku 'c'. Alokuje pamet pro cap objektu (kapacitu). Ukazatel NULL u pole objektu znamena kapacitu 0. */ void init_cluster(struct cluster_t *c, int cap) { assert(c != NULL); assert(cap >= 0); c->size = 0; c->capacity = cap; c->obj = malloc(sizeof(struct obj_t) * cap); } /* Odstraneni vsech objektu shluku a inicializace na prazdny shluk. */ void clear_cluster(struct cluster_t *c) { c->capacity = 0; c->size = 0; free(c->obj); } /// Chunk of cluster objects. Value recommended for reallocation. const int CLUSTER_CHUNK = 10; /* Zmena kapacity shluku 'c' na kapacitu 'new_cap'. */ struct cluster_t *resize_cluster(struct cluster_t *c, int new_cap) { // TUTO FUNKCI NEMENTE assert(c); assert(c->capacity >= 0); assert(new_cap >= 0); if (c->capacity >= new_cap) return c; size_t size = sizeof(struct obj_t) * new_cap; void *arr = realloc(c->obj, size); if (arr == NULL) return NULL; c->obj = (struct obj_t *) arr; c->capacity = new_cap; return c; } /* Prida objekt 'obj' na konec shluku 'c'. Rozsiri shluk, pokud se do nej objekt nevejde. */ void append_cluster(struct cluster_t *c, struct obj_t obj) { if (c->capacity > c->size) { c->obj[c->size] = obj; c->size++; } else { c = resize_cluster(c, c->capacity + CLUSTER_CHUNK); c->obj[c->size] = obj; c->size++; } } /* Seradi objekty ve shluku 'c' vzestupne podle jejich identifikacniho cisla. */ void sort_cluster(struct cluster_t *c); /* Do shluku 'c1' prida objekty 'c2'. Shluk 'c1' bude v pripade nutnosti rozsiren. Objekty ve shluku 'c1' budou serazeny vzestupne podle identifikacniho cisla. Shluk 'c2' bude nezmenen. */ void merge_clusters(struct cluster_t *c1, struct cluster_t *c2) { assert(c1 != NULL); assert(c2 != NULL); for (int i = 0; i < c2->size; i++) { append_cluster(c1, c2->obj[i]); } sort_cluster(c1); } /**********************************************************************/ /* Prace s polem shluku */ /* Odstrani shluk z pole shluku 'carr'. Pole shluku obsahuje 'narr' polozek (shluku). Shluk pro odstraneni se nachazi na indexu 'idx'. Funkce vraci novy pocet shluku v poli. */ int remove_cluster(struct cluster_t *carr, int narr, int idx) { assert(idx < narr); assert(narr > 0); // Remove given cluster from cluster array clear_cluster(&carr[idx]); // Regorganize cluster array for (int i = idx; i < narr - 1; i++) { carr[i].capacity = carr[i + 1].capacity; carr[i].size = carr[i + 1].size; carr[i].obj = carr[i + 1].obj; } return narr - 1; } /* Pocita Euklidovskou vzdalenost mezi dvema objekty. */ float obj_distance(struct obj_t *o1, struct obj_t *o2) { assert(o1 != NULL); assert(o2 != NULL); return sqrtf(pow(o1->x - o2->x, 2) + pow(o1->y - o2->y, 2)); } /** * Calculates centroid of given cluster * @param cluster Two-dimensional cluster * @return Centroid of given cluster (obj_t) */ struct obj_t getCentroid(struct cluster_t *cluster) { float sumX = 0; float sumY = 0; for (int i = 0; i < cluster->size; i++) { sumX += cluster->obj[i].x; sumY += cluster->obj[i].y; } struct obj_t centroid = {0, sumX / cluster->size, sumY / cluster->size}; return centroid; } /* Pocita vzdalenost dvou shluku. */ float cluster_distance(struct cluster_t *c1, struct cluster_t *c2) { assert(c1 != NULL); assert(c1->size > 0); assert(c2 != NULL); assert(c2->size > 0); struct obj_t c1_Centroid = getCentroid(c1); struct obj_t c2_Centroid = getCentroid(c2); return obj_distance(&c1_Centroid, &c2_Centroid); } /* Funkce najde dva nejblizsi shluky. V poli shluku 'carr' o velikosti 'narr' hleda dva nejblizsi shluky. Nalezene shluky identifikuje jejich indexy v poli 'carr'. Funkce nalezene shluky (indexy do pole 'carr') uklada do pameti na adresu 'c1' resp. 'c2'. */ void find_neighbours(struct cluster_t *carr, int narr, int *c1, int *c2) { assert(narr > 0); float lowestDistance = INT_MAX; float lastDistance; int c1_Index, c2_Index; for (int a = 0; a < narr; a++) { for (int b = a + 1; b < narr; b++) { lastDistance = cluster_distance(&carr[a], &carr[b]); if (lastDistance < lowestDistance) { lowestDistance = lastDistance; c1_Index = a; c2_Index = b; } } } *c1 = c1_Index; *c2 = c2_Index; } // pomocna funkce pro razeni shluku static int obj_sort_compar(const void *a, const void *b) { // TUTO FUNKCI NEMENTE const struct obj_t *o1 = (const struct obj_t *) a; const struct obj_t *o2 = (const struct obj_t *) b; if (o1->id < o2->id) return -1; if (o1->id > o2->id) return 1; return 0; } /* Razeni objektu ve shluku vzestupne podle jejich identifikatoru. */ void sort_cluster(struct cluster_t *c) { // TUTO FUNKCI NEMENTE qsort(c->obj, c->size, sizeof(struct obj_t), &obj_sort_compar); } /* Tisk shluku 'c' na stdout. */ void print_cluster(struct cluster_t *c) { // TUTO FUNKCI NEMENTE for (int i = 0; i < c->size; i++) { if (i) putchar(' '); printf("%d[%g,%g]", c->obj[i].id, c->obj[i].x, c->obj[i].y); } putchar('\n'); } /* Ze souboru 'filename' nacte objekty. Pro kazdy objekt vytvori shluk a ulozi jej do pole shluku. Alokuje prostor pro pole vsech shluku a ukazatel na prvni polozku pole (ukalazatel na prvni shluk v alokovanem poli) ulozi do pameti, kam se odkazuje parametr 'arr'. Funkce vraci pocet nactenych objektu (shluku). V pripade nejake chyby uklada do pameti, kam se odkazuje 'arr', hodnotu NULL. */ int load_clusters(char *filename, struct cluster_t **arr) { assert(arr != NULL); FILE *file; int itemsCount; // Check if file can be opened, if not fail if ((file = fopen(filename, "r")) == NULL) { *arr = NULL; printf(ERROR_BAD_FILE); return (EXIT_FAILURE); } // Check if items count is specified, if not fail if (fscanf(file, "count=%d", &itemsCount) != 1) { fclose(file); printf(ERROR_BAD_FILE); return (EXIT_FAILURE); } // Allocate memory for all items *arr = malloc(sizeof(struct cluster_t) * itemsCount); // Iterate through items for (int i = 0; i < itemsCount; i++) { int id, x, y; // Check if we won't run out of items before itemsCount is reached if (fscanf(file, "%d %d %d", &id, &x, &y) == EOF) { fclose(file); return (EXIT_FAILURE); } // Check if both X & Y are within bounds if (x < 0 || y < 0 || x > 1000 || y > 1000) { fclose(file); return (EXIT_FAILURE); } // Check if every item has an unique ID for (int r = 0; r < i; r++) { if ((*arr)[r].obj->id != id) continue; else { fclose(file); printf(ERROR_UNIQUE_IDS); return (EXIT_FAILURE); } } struct cluster_t cluster; init_cluster(&cluster, 1); struct obj_t object = {id, x, y}; append_cluster(&cluster, object); (*arr)[i] = cluster; } fclose(file); return itemsCount; } /* Tisk pole shluku. Parametr 'carr' je ukazatel na prvni polozku (shluk). Tiskne se prvnich 'narr' shluku. */ void print_clusters(struct cluster_t *carr, int narr) { printf("Clusters:\n"); for (int i = 0; i < narr; i++) { printf("cluster %d: ", i); print_cluster(&carr[i]); } } int main(int argc, char *argv[]) { struct cluster_t *clusters; int itemsCount = 0; int totalItemsCount = 1; if (argc == 2) { // do nothing, totalItemsCount is already set by default :) } else if (argc == 3) { totalItemsCount = atoi(argv[2]); if (totalItemsCount <= 0) { printf(ERROR_BAD_ARGUMENTS); return (EXIT_FAILURE); } } else { printf(ERROR_BAD_ARGUMENTS); return (EXIT_FAILURE); } // Load cluster array itemsCount = load_clusters(argv[1], &clusters); if (itemsCount == -1 || itemsCount < totalItemsCount) { printf(ERROR_ITEMS); free(clusters); return (EXIT_FAILURE); } else if (clusters == NULL) { printf(ERROR_ITEMS); return (EXIT_FAILURE); } while (itemsCount > totalItemsCount) { int index1, index2; find_neighbours(clusters, itemsCount, &index1, &index2); merge_clusters(&clusters[index1], &clusters[index2]); itemsCount = remove_cluster(clusters, itemsCount, index2); } print_clusters(clusters, itemsCount); for(int i = 0; i < totalItemsCount; i++) { clear_cluster(&clusters[i]); } free(clusters); return (EXIT_SUCCESS); }
the_stack_data/132199.c
#include<stdio.h> void main() { int a,b,c; printf("Enter two Numbers : "); scanf("%d %d",&a,&b); c=a/b; printf("Division is %d",c); }
the_stack_data/59512649.c
/* * Generated by util/mkerr.pl DO NOT EDIT * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <openssl/err.h> #include <openssl/x509err.h> #ifndef OPENSSL_NO_ERR static const ERR_STRING_DATA X509_str_reasons[] = { {ERR_PACK(ERR_LIB_X509, 0, X509_R_AKID_MISMATCH), "akid mismatch"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_BAD_SELECTOR), "bad selector"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_BAD_X509_FILETYPE), "bad x509 filetype"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_BASE64_DECODE_ERROR), "base64 decode error"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_CANT_CHECK_DH_KEY), "cant check dh key"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_CERT_ALREADY_IN_HASH_TABLE), "cert already in hash table"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_CRL_ALREADY_DELTA), "crl already delta"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_CRL_VERIFY_FAILURE), "crl verify failure"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_IDP_MISMATCH), "idp mismatch"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_INVALID_ATTRIBUTES), "invalid attributes"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_INVALID_DIRECTORY), "invalid directory"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_INVALID_FIELD_NAME), "invalid field name"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_INVALID_TRUST), "invalid trust"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_ISSUER_MISMATCH), "issuer mismatch"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_KEY_TYPE_MISMATCH), "key type mismatch"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_KEY_VALUES_MISMATCH), "key values mismatch"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_LOADING_CERT_DIR), "loading cert dir"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_LOADING_DEFAULTS), "loading defaults"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_METHOD_NOT_SUPPORTED), "method not supported"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_NAME_TOO_LONG), "name too long"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_NEWER_CRL_NOT_NEWER), "newer crl not newer"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_NO_CERTIFICATE_FOUND), "no certificate found"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_NO_CERTIFICATE_OR_CRL_FOUND), "no certificate or crl found"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY), "no cert set for us to verify"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_NO_CRL_FOUND), "no crl found"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_NO_CRL_NUMBER), "no crl number"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_PUBLIC_KEY_DECODE_ERROR), "public key decode error"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_PUBLIC_KEY_ENCODE_ERROR), "public key encode error"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_SHOULD_RETRY), "should retry"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN), "unable to find parameters in chain"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY), "unable to get certs public key"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_UNKNOWN_KEY_TYPE), "unknown key type"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_UNKNOWN_NID), "unknown nid"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_UNKNOWN_PURPOSE_ID), "unknown purpose id"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_UNKNOWN_TRUST_ID), "unknown trust id"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_UNSUPPORTED_ALGORITHM), "unsupported algorithm"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_WRONG_LOOKUP_TYPE), "wrong lookup type"}, {ERR_PACK(ERR_LIB_X509, 0, X509_R_WRONG_TYPE), "wrong type"}, {0, NULL} }; #endif int ERR_load_X509_strings(void) { #ifndef OPENSSL_NO_ERR if (ERR_func_error_string(X509_str_reasons[0].error) == NULL) ERR_load_strings_const(X509_str_reasons); #endif return 1; }
the_stack_data/198579529.c
/* $Header: /home/schj/src/vamps_0.99g/src/met.lib/RCS/int.c,v 1.2 1999/01/06 12:13:01 schj Alpha $ */ /* * $RCSfile: int.c,v $ * $Author: schj $ * $Date: 1999/01/06 12:13:01 $ */ /*F:int * Several methods to determine rainfall interception by plants/trees. * * (C) Jaap Schellekens * */ static char RCSid[] = "$Id: int.c,v 1.2 1999/01/06 12:13:01 schj Alpha $"; #include <math.h> #include <string.h> static double dmaxarg1,dmaxarg2; #define DMAX(a,b) (dmaxarg1=(a),dmaxarg2=(b),(dmaxarg1) > (dmaxarg2) ?\ (dmaxarg1) : (dmaxarg2)) static double dminarg1,dminarg2; #define DMIN(a,b) (dminarg1=(a),dminarg2=(b),(dminarg1) < (dminarg2) ?\ (dminarg1) : (dminarg2)) /*C:lai_int *@void lai_int (double P,double lai,double coeff,double *throughfall, *@ double *stemflow, double *interception) * * TOPOG type interception using a lai fraction */ void lai_int (double P,double lai,double coeff,double *throughfall,double *stemflow, double *interception) { *interception = lai * coeff <= P? lai * coeff : P; *throughfall = P - (*interception); *stemflow =0.0; } /*C:gash *@ int gash (int method, double p,double p_tr,double S, *@ double E,double P,double T, double thefrac, *@ double *throughfall,double *stemflow, *@ double *interception,double *SS,double LAI) * * calculate forest interception using Gash's model * see GASH79165 * If E_avg/R is defined in the input file, this value * is used in stead of using calculated E_avg. * * Amount of P needed to fill the canopy: * *@ P' = -RS/E ln [1- E/R(1-p-p_Tr)^-1)] (mm/d) *@ *@ p free Throughfall coefficient *@ p_tr stemflow coefficient *@ S storage capacity of the canopy (mm) *@ E average evaporation during storms (mm/hr) *@ R average precipitation (mm/hr) *@ T duration of storm * method == 0 is old * * Adapted version: * If LAI > 0 then the following assumptions are made: * * S = S* LAI * * E = E* LAI * * Ss = Ss* LAI * * p_tr = p_tr* LAI * * p = exp(-p * LAI) */ int gash (int method, double p,double p_tr,double S,double E,double P,double T, double thefrac,double *throughfall,double *stemflow, double *interception,double *SS,double LAI) { double P_sat; /*amount of P needed to fill canopy*/ double R; /*average P (mm/hr)*/ double E_avg; /*average E (mm/hr)*/ double Iwet,Isat,Idry; double Sorg; LAI = LAI <= 0.0? LAI = 1.0 : LAI; /* do LAI modifications */ if (LAI != 1.0){ S *= LAI; thefrac *= LAI; E *= LAI; p_tr *= LAI; p = exp(-p * LAI); } /* recalculate to cm as vamps uses cm/day */ Sorg = S; P = P*T; E = E*T; R = P; E_avg = E; if (thefrac == 0.0) thefrac = E_avg / R; if (method == 0){ /* old method */ P_sat = (-S / thefrac) * log (1 - (LAI * thefrac/(1 - p - p_tr))); if (P_sat > P){ /* small storms */ Iwet = (1 - p - p_tr)*P; Isat = 0.0; Idry = 0.0; *stemflow = p_tr * P; *interception = Iwet+Isat+Idry; *throughfall = P - (*interception) - (*stemflow); *interception /= T; *throughfall /= T; *stemflow /= T; return 0; }else{ Iwet = ((1 - p -p_tr) * P_sat) - S; Isat = (thefrac) * (P - P_sat); Idry = S; *interception = Iwet + Isat +Idry; *stemflow = p_tr * P; *throughfall = P - *interception - *stemflow; *stemflow/=T; *throughfall/=T; *interception/=T; return 1; } }else{ /* Adapted gash for small timesteps */ /* First let the canopy dry SS */ *SS = *SS - E >= 0.0 ? *SS - E : 0.0; /* evaporation + drainage */ S -= *SS; /* Substract amount in canopy from storage */ S = S < 0.0 ? 0.0 : S; P_sat = (-S / thefrac) * log (1 - (thefrac/(1 - p - p_tr))); if (P_sat > P){/* small storms */ Iwet = (1 - p - p_tr)*P; Isat = 0.0; Idry = 0.0; *stemflow = p_tr * P; *interception = Iwet+Isat+Idry;; *throughfall = P - (*interception) - (*stemflow); *interception /= T; *throughfall /= T; *stemflow /= T; *SS += (1-p-p_tr)*P; *SS = *SS > Sorg ? Sorg : *SS; return 0; }else{ Iwet = ((1 - p -p_tr) * P_sat) - S; Isat = (thefrac) * (P - P_sat); Idry = S < E? S : E; *interception = Iwet + Isat +Idry; *stemflow = p_tr * P; *throughfall = P - *interception - *stemflow; *stemflow/=T; *throughfall/=T; *interception/=T; *SS = Sorg; /* Full canopy */ return 1; } } } /*C:calder *@void calder (double gamma,double delta,double P,double *interception, *@ double *throughfall, double *stemflow) * * P Precipitation * gamma Max interception loss * delta Fitting parameter */ void calder (double gamma,double delta,double P,double *interception, double *throughfall, double *stemflow) { *interception = gamma * (1 - exp (-delta * P)); *stemflow = 0; *throughfall = P - *interception; } /*C:c_drainage *@double c_drainge(double C, double S) * * canopy drainage calculated using actual canopy water content * and max */ double c_drainage(double C, double S) { double b = 3.7; double Do = 16.4160; /*cm/day = 0.0019mm/min*/ return C < S? 0.0 : Do * exp (b*(C-S)); } /*C:rutter *@double rutter (double p,double p_tr,double P,double E,double S, *@ double Cinit, double *TF,double *SF,double *Ei, *@ double *I,double tstep) * * Calculates interception according to the rutter model. The equation is * solved direct implicitly: *@ Cj = Cj-1 + [(1-p-p_tr)P-Eic-Hc]delta_t * * At the moment evap from stem = 0.0! * * Input variables: * E = evaporation from wet surface [cm] * P = precipitation [cm] * Cinit = actual canopy storage [cm] * S = max canopy storage [cm] * p = free throughfall coefficient * p_tr = fraction of rain diverted to trunks * * The following variables are set: * TF * SF * Ei * I * * Cinit is returned. */ double rutter (double p,double p_tr,double P,double E,double S,double Cinit, double *TF,double *SF,double *Ei, double *I,double tstep) { double delta_td = .04166666666666666667; /* max 1.0 h (dry) */ double delta_tw = .00416666666666666667; /* max 0.1 h (wet) */ double delta_t; /* actual delta_t */ double t = 0.0; /* time */ double d=0.0,davg = 0.0; /* tstep drainage and average drainage */ double ei = 0.0; /* tstep wet canopy evap */ double dC=0.0; /* change in storage */ int steps = 0; /* number of steps */ *I=0.0; *TF=0.0; *SF=0.0; *Ei=0.0; while (t < tstep){ steps++; /* determine max tstep... */ if (Cinit <= 0.0) delta_t = DMIN(delta_td, tstep); else delta_t = DMIN(delta_tw, tstep); /* synchronize with external tstep... */ delta_t = t + delta_t > tstep ? tstep - t: delta_t; ei = E * Cinit/S;/*..wet surface E as fraction of filled canopy*/ /* change in storage and actual storage ... */ dC = ((1 - p - p_tr) * P - ei - d) * delta_t; Cinit += dC; d = c_drainage(Cinit,S); /* Drainage in cm/day */ /* add surplus in Cinit to drainage...*/ d += Cinit > S ? Cinit - S: 0.0; Cinit = Cinit > S ? S : Cinit; /* calculate average drainage, wet canop E, trhougfall... */ davg += d * delta_t; *Ei += ei * delta_t; *TF += (d + (p * P)) * delta_t; /* Throughfall in cm */ Cinit = DMAX(Cinit,0.0); /* no negative C allowed */ t += delta_t; /* increase time */ } /* now calculate stemflow and interception losses...*/ *SF = P * p_tr; *I = P - (*TF) - *SF; return Cinit; }
the_stack_data/23576022.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* maff_revalpha.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: mdesalle <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/05/20 10:39:54 by mdesalle #+# #+# */ /* Updated: 2021/05/31 10:03:02 by mdesalle ### ########.fr */ /* */ /* ************************************************************************** */ #include <unistd.h> /* * just a simple write function, nothing fancy. */ int main(void) { write(1, "zYxWvUtSrQpOnMlKjIhGfEdCbA\n", 27); return (0); }
the_stack_data/133211.c
#include <stdio.h> int f1() { int nAppartamenti; printf("Inserisci il numero di appartamenti del condominio: "); scanf("%d", &nAppartamenti); return nAppartamenti; } void f2() {} void f3() {} void f4() {} void f5() {} void f6() {} void f7() {} void f8() {} void f9() {} int main() { int nAppartamenti, nAffittati; // 1 nAppartamenti = f1(); // 2 printf("Inserisci il numero di appartamenti in affitto: "); scanf("%d", &nAffittati); // 3 if (nAffittati > nAppartamenti-nAffittati) { printf("Ci sono piu' appartamenti in affitto che di proprieta'\n"); } else { printf("Ci sono piu' appartamenti di proprieta' che in affitto (o sono uguali)\n"); } // 4+5 int metriQuadri[nAppartamenti]; int totmq = 0; for (int i = 0; i < nAppartamenti; i++) { printf("Inserisci la dimensione in metri quadri dell'appartamento %d: ", i+1); scanf("%d", &metriQuadri[i]); totmq += metriQuadri[i]; } printf("Il totale dei metri quadri: %d\n", totmq); // 6 float ampiezzaMedia = (float)totmq/nAppartamenti; // 73 int nAmpiezzaSuperiore = 0; for (int i = 0; i < nAppartamenti; i++) { if (metriQuadri[i] > ampiezzaMedia) nAmpiezzaSuperiore++; } if (nAmpiezzaSuperiore > nAppartamenti-nAmpiezzaSuperiore) printf("Ci sono piu' appartamenti con ampiezza superiore alla media"); else printf("Ci sono piu' appartamenti con ampiezza inferiore alla media"); //8 float spesaElettrica; printf("\nA quanto ammonta la spesa elettrica condominiale?\n> "); scanf("%f", &spesaElettrica); //9 printf("\nSPESA ELETTRICA PER APPARTAMENTO (In base ai metri quadri - Approssimata al centesimo)\n"); printf("|%-13s|%-13s|%-13s|", "Appartamento", "Metri quadri", "SPESA"); for (int i = 0; i < nAppartamenti; i++) { printf("\n|%-13d|%-13d|%-13.2f|", i+1, metriQuadri[i], spesaElettrica/(float)totmq*metriQuadri[i]); } }
the_stack_data/114557.c
#include <stdio.h> #include <stdlib.h> int main(){ int n; printf("Nhap so phan tu cua mang: "); scanf("%i",&n); float *a; a=(float *)calloc(n,sizeof(int)); for (int i=0;i<n;i++){ printf("Nhap phan tu thu %i cua mang: ",i+1); scanf("%f",a+i); } printf("\nMang vua nhap la: "); for (int i=0;i<n;i++){ printf("%f ",*(a+i)); } for (int j=n-1;j>=1;j--){ for (int i=0;i<=j-1;i++){ if (*(a+i)<*(a+i+1)){ float tg=*(a+i); *(a+i)=*(a+i+1); *(a+i+1)=tg; } } } printf("\nMang sau khi sap xep la: "); for (int i=0;i<n;i++){ printf("%f ",*(a+i)); } int d1=0,d2=0; float sumd=0,suma=0; for (int i=0;i<n;i++){ if (*(a+i)<0){ suma+=*(a+i); d1++; } else{ sumd+=*(a+i); d2++; } } float ansa=suma/d1,ansd=sumd/d2; printf("\nTrung binh cong cua cac so am la %f\n",ansa); printf("Trung binh cong cua cac so khong am la %f\n",ansd); return 0; }
the_stack_data/179831869.c
#ifndef lint static char SccsId[] = "@(#)doy.c 44.1 9/23/91"; #endif /* DOY * * This function will convert mon and day within the year and return it as * the value of the function. If mon or day are illegal values, the value * of the function will be 0 (0). */ int ndays[13] = {0,0,31,59,90,120,151,181,212,243,273,304,334}; doy(mon,day,year) int mon, day, year; { int inc; if (mon < 1 || mon > 12) return(0); if (day < 1 || day > 31) return(0); if (lpyr(year) && mon > 2) inc = 1; else inc = 0; return(ndays[mon] + day + inc); } /******************************************************************************/ /* DOM * * This function converts a day within the year (dofy) to the month and * day of the month. If dofy is an illegal value, mon and day will be * returned as 0. */ int mdays[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; dom(dofy,mon,day,year) int dofy,*mon,*day,year; { int iday; if (dofy < 1) { *mon = 0; *day = 0; return(0); } if (lpyr(year)) mdays[2] = 29; else mdays[2] = 28; for (*mon = 1; *mon <= 12; (*mon)++) { *day = dofy; if ((dofy -= mdays[*mon]) <= 0) return(1); } *mon = 0; *day = 0; return(0); } /******************************************************************************/ /* LPYR * * This function returns 1 if year is a leap year. */ lpyr(year) int year; { if (year%400 == 0) return(1); if (year%4 != 0) return(0); if (year%100 == 0) return(0); else return(1); }
the_stack_data/43887943.c
#include <stdio.h> #define SZ_BUF 32 #define BYTE unsigned char void main() { int sz, i; BYTE buf[SZ_BUF]; while (sz = read(0, &buf, SZ_BUF)) { #ifdef SOLARIS printf("echo \""); #else printf("echo -e \""); #endif for (i = 0; i< sz; i++) printf("\\%04o", buf[i]); printf("\\c\"\n"); } }
the_stack_data/132953528.c
#include <stdio.h> int main() { printf("\nHello, world.\n"); float number; printf("Type a number: "); scanf("%f", &number); if ( number > 0) { printf("Inverse of number %.2f is %.2f\n", number, ( ( 1 / number ) )); } else { printf("Opposite of number %.2f is %.2f\n", number, ( number * -1 )); } return 0; }
the_stack_data/150141102.c
/* * Aufgabe 6.6 * Peter Smek, 14.11.2021 */ #include <assert.h> #include <stdio.h> #include <stdlib.h> /** * Returns the length of the string. */ int str_length(char *str) { int i = 0; // Increment i until str[i] is the 0-terminator of the string. for (i = 0; str[i] != '\0'; ++i) {} return i; } /** * Converts the char c to lowercase. */ char to_lowercase(char c) { // Return c if c is not uppercase. if (c < 'A' || c > 'Z') { return c; } // Return c in lowercase. See https://www.ascii-code.com/. return c + ('a' - 'A'); } /** * Checks if first_str is an anagram of second_str. */ int anagram(char *first_str, char* second_str) { int n = str_length(first_str); // If the two strings don't have the same length, then they can't be an anagram of each other. if (n != str_length(second_str)) { return 0; } // Create vector containing all chars of string 1. int c_n = n; char *c_v = malloc(c_n * sizeof(char)); for (int i = 0; i < n; ++i) { c_v[i] = to_lowercase(first_str[i]); } // Check if string 2 can be build from the chars in c_v. for (int i = 0; i < n; ++i) { char c = to_lowercase(second_str[i]); // Check if the remaining chars contain c. int contained = 0; for (int i_c = 0; i_c < c_n; ++i_c) { if (c_v[i_c] == c) { contained = 1; // Remove c from c_v. for (int i_c_v = i_c; i_c_v < c_n - 1; ++i_c_v) { c_v[i_c_v] = c_v[i_c_v + 1]; } --c_n; break; } } // Return 0 if the remaining chars don't contain the ith char of string 2 if (!contained) { free(c_v); return 0; } } free(c_v); return 1; } /** * Gets a string from stdin. */ char* scan_str(char *str, int *len) { // Add character to string. char c = 0; while (scanf("%c", &c) == 1 && c != '\n') { str = realloc(str, (*len + 1) * sizeof(char)); assert(str != NULL); str[*len] = c; ++*len; } // Add 0 string-terminator. str = realloc(str, (*len + 1) * sizeof(char)); assert(str != NULL); str[*len] = 0; return str; } int main() { int str_1_len = 0, str_2_len = 0; char *str_1 = NULL, *str_2 = NULL; // Get sring 1 from the user. printf("String 1: "); str_1 = scan_str(str_1, &str_1_len); // Get sring 2 from the user. printf("String 2: "); str_2 = scan_str(str_2, &str_2_len); // Print if string 1 is an anagram of string 2. if (anagram(str_1, str_2)) { printf("\"%s\" is an anagram of \"%s\".\n", str_1, str_2); } else { printf("\"%s\" is not an anagram of \"%s\".\n", str_1, str_2); } // Free allocated memory. free(str_1); free(str_2); return 0; }
the_stack_data/40761768.c
#include <stdio.h> #include <stdlib.h> void scilab_rt_graduate_d0i0i0i0_d0d0i0(double scalarin0, int scalarin1, int scalarin2, int scalarin3, double* scalarout0, double* scalarout1, int* scalarout2) { printf("%f", scalarin0); printf("%d", scalarin1); printf("%d", scalarin2); printf("%d", scalarin3); *scalarout0 = rand(); *scalarout1 = rand(); *scalarout2 = rand(); }
the_stack_data/210727.c
/* * Copyright (c) 2011-2014 Graham Edgecombe <[email protected]> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <string.h> size_t strlen(const char *str) { const char *s; for (s = str; *s; s++); return (size_t) (s - str); }
the_stack_data/97139.c
/* * FreeRTOS V202112.00 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * http://www.FreeRTOS.org * http://aws.amazon.com/freertos * * 1 tab == 4 spaces! */ /* * "Reg test" tasks - These fill the registers with known values, then check * that each register maintains its expected value for the lifetime of the * task. Each task uses a different set of values. The reg test tasks execute * with a very low priority, so get preempted very frequently. A register * containing an unexpected value is indicative of an error in the context * switching mechanism. */ void vRegTest1Task( void ) __attribute__((naked)); void vRegTest2Task( void ) __attribute__((naked)); void vRegTest1Task( void ) { __asm volatile ( ".extern ulRegTest1LoopCounter \n" " \n" " /* Fill the core registers with known values. */ \n" " movs r1, #101 \n" " movs r2, #102 \n" " movs r3, #103 \n" " movs r4, #104 \n" " movs r5, #105 \n" " movs r6, #106 \n" " movs r7, #107 \n" " movs r0, #108 \n" " mov r8, r0 \n" " movs r0, #109 \n" " mov r9, r0 \n" " movs r0, #110 \n" " mov r10, r0 \n" " movs r0, #111 \n" " mov r11, r0 \n" " movs r0, #112 \n" " mov r12, r0 \n" " movs r0, #100 \n" " \n" "reg1_loop: \n" " \n" " cmp r0, #100 \n" " bne reg1_error_loop \n" " cmp r1, #101 \n" " bne reg1_error_loop \n" " cmp r2, #102 \n" " bne reg1_error_loop \n" " cmp r3, #103 \n" " bne reg1_error_loop \n" " cmp r4, #104 \n" " bne reg1_error_loop \n" " cmp r5, #105 \n" " bne reg1_error_loop \n" " cmp r6, #106 \n" " bne reg1_error_loop \n" " cmp r7, #107 \n" " bne reg1_error_loop \n" " movs r0, #108 \n" " cmp r8, r0 \n" " bne reg1_error_loop \n" " movs r0, #109 \n" " cmp r9, r0 \n" " bne reg1_error_loop \n" " movs r0, #110 \n" " cmp r10, r0 \n" " bne reg1_error_loop \n" " movs r0, #111 \n" " cmp r11, r0 \n" " bne reg1_error_loop \n" " movs r0, #112 \n" " cmp r12, r0 \n" " bne reg1_error_loop \n" " \n" " /* Everything passed, increment the loop counter. */ \n" " push { r1 } \n" " ldr r0, =ulRegTest1LoopCounter \n" " ldr r1, [r0] \n" " add r1, r1, #1 \n" " str r1, [r0] \n" " \n" " /* Yield to increase test coverage. */ \n" " movs r0, #0x01 \n" " ldr r1, =0xe000ed04 \n" /*NVIC_INT_CTRL */ " lsl r0, #28 \n" /* Shift to PendSV bit */ " str r0, [r1] \n" " dsb \n" " pop { r1 } \n" " \n" " /* Start again. */ \n" " movs r0, #100 \n" " b reg1_loop \n" " \n" "reg1_error_loop: \n" " /* If this line is hit then there was an error in a core register value. \n" " The loop ensures the loop counter stops incrementing. */ \n" " b reg1_error_loop \n" " nop \n" ); } /*-----------------------------------------------------------*/ void vRegTest2Task( void ) { __asm volatile ( ".extern ulRegTest2LoopCounter \n" " \n" " /* Fill the core registers with known values. */ \n" " movs r1, #1 \n" " movs r2, #2 \n" " movs r3, #3 \n" " movs r4, #4 \n" " movs r5, #5 \n" " movs r6, #6 \n" " movs r7, #7 \n" " movs r0, #8 \n" " movs r8, r0 \n" " movs r0, #9 \n" " mov r9, r0 \n" " movs r0, #10 \n" " mov r10, r0 \n" " movs r0, #11 \n" " mov r11, r0 \n" " movs r0, #12 \n" " mov r12, r0 \n" " movs r0, #10 \n" " \n" "reg2_loop: \n" " \n" " cmp r0, #10 \n" " bne reg2_error_loop \n" " cmp r1, #1 \n" " bne reg2_error_loop \n" " cmp r2, #2 \n" " bne reg2_error_loop \n" " cmp r3, #3 \n" " bne reg2_error_loop \n" " cmp r4, #4 \n" " bne reg2_error_loop \n" " cmp r5, #5 \n" " bne reg2_error_loop \n" " cmp r6, #6 \n" " bne reg2_error_loop \n" " cmp r7, #7 \n" " bne reg2_error_loop \n" " movs r0, #8 \n" " cmp r8, r0 \n" " bne reg2_error_loop \n" " movs r0, #9 \n" " cmp r9, r0 \n" " bne reg2_error_loop \n" " movs r0, #10 \n" " cmp r10, r0 \n" " bne reg2_error_loop \n" " movs r0, #11 \n" " cmp r11, r0 \n" " bne reg2_error_loop \n" " movs r0, #12 \n" " cmp r12, r0 \n" " bne reg2_error_loop \n" " \n" " /* Everything passed, increment the loop counter. */ \n" " push { r1 } \n" " ldr r0, =ulRegTest2LoopCounter \n" " ldr r1, [r0] \n" " add r1, r1, #1 \n" " str r1, [r0] \n" " pop { r1 } \n" " \n" " /* Start again. */ \n" " movs r0, #10 \n" " b reg2_loop \n" " \n" "reg2_error_loop: \n" " /* If this line is hit then there was an error in a core register value. \n" " The loop ensures the loop counter stops incrementing. */ \n" " b reg2_error_loop \n" " nop \n" ); } /*-----------------------------------------------------------*/
the_stack_data/170452754.c
/*** * This code is a part of EvoApproxLib library (ehw.fit.vutbr.cz/approxlib) distributed under The MIT License. * When used, please cite the following article(s): V. Mrazek, R. Hrbacek, Z. Vasicek and L. Sekanina, "EvoApprox8b: Library of approximate adders and multipliers for circuit design and benchmarking of approximation methods". Design, Automation & Test in Europe Conference & Exhibition (DATE), 2017, Lausanne, 2017, pp. 258-261. doi: 10.23919/DATE.2017.7926993 * This file contains a circuit from evoapprox8b dataset. Note that a new version of library was already published. ***/ #include <stdint.h> #include <stdlib.h> /// Approximate function add8_095 /// Library = EvoApprox8b /// Circuit = add8_095 /// Area (180) = 772 /// Delay (180) = 1.360 /// Power (180) = 185.70 /// Area (45) = 57 /// Delay (45) = 0.510 /// Power (45) = 18.14 /// Nodes = 13 /// HD = 176512 /// MAE = 3.20312 /// MSE = 18.50000 /// MRE = 1.68 % /// WCE = 11 /// WCRE = 300 % /// EP = 85.9 % uint16_t add8_095(uint8_t a, uint8_t b) { uint16_t c = 0; uint8_t n4 = (a >> 2) & 0x1; uint8_t n6 = (a >> 3) & 0x1; uint8_t n8 = (a >> 4) & 0x1; uint8_t n10 = (a >> 5) & 0x1; uint8_t n12 = (a >> 6) & 0x1; uint8_t n14 = (a >> 7) & 0x1; uint8_t n20 = (b >> 2) & 0x1; uint8_t n22 = (b >> 3) & 0x1; uint8_t n24 = (b >> 4) & 0x1; uint8_t n26 = (b >> 5) & 0x1; uint8_t n28 = (b >> 6) & 0x1; uint8_t n30 = (b >> 7) & 0x1; uint8_t n32; uint8_t n39; uint8_t n40; uint8_t n53; uint8_t n79; uint8_t n127; uint8_t n132; uint8_t n182; uint8_t n213; uint8_t n232; uint8_t n233; uint8_t n282; uint8_t n283; uint8_t n332; uint8_t n333; uint8_t n382; uint8_t n383; n32 = ~(n22 & n20 & n4); n39 = ~n32; n40 = n20 ^ n20; n53 = n6 & n39; n79 = n53; n127 = ~n40; n132 = n4 | n20; n182 = n6 | n22; n213 = n79; n232 = (n8 ^ n24) ^ n213; n233 = (n8 & n24) | (n24 & n213) | (n8 & n213); n282 = (n10 ^ n26) ^ n233; n283 = (n10 & n26) | (n26 & n233) | (n10 & n233); n332 = (n12 ^ n28) ^ n283; n333 = (n12 & n28) | (n28 & n283) | (n12 & n283); n382 = (n14 ^ n30) ^ n333; n383 = (n14 & n30) | (n30 & n333) | (n14 & n333); c |= (n127 & 0x1) << 0; c |= (n127 & 0x1) << 1; c |= (n132 & 0x1) << 2; c |= (n182 & 0x1) << 3; c |= (n232 & 0x1) << 4; c |= (n282 & 0x1) << 5; c |= (n332 & 0x1) << 6; c |= (n382 & 0x1) << 7; c |= (n383 & 0x1) << 8; return c; }
the_stack_data/154827723.c
#include <sys/uio.h> #include <stdlib.h> int main(void) { return process_vm_readv(0, NULL, 0, NULL, 0, 0) + process_vm_writev(0, NULL, 0, NULL, 0, 0); }
the_stack_data/98573938.c
// code: 1 int main() { return 12.0 == 12; }
the_stack_data/59511892.c
#include <stdio.h> // declare void testFunction(int x); int r = 30; int h = 40; int main(void){ typedef char *char_type; char_type ch; // &ch = 'a'; const int kaka = 15; // kaka = 20; // error int i = 100; static int a; // printf("%c\n", ch); if(i > 10){ register int x = 30; printf("x = %d, a = %d\n", x, a); } int j; for(j = 0; j < 20 ; j++){ static int q = 0; q += j; } // printf("%d\n", q); int test(int i){ printf("%d\n", i); } test(i); } // define void testFunction(int x){ // test(20); printf("%d\n", x); }
the_stack_data/62637442.c
/* Question 4 : Rewrite the above program by taking the student_name and address as character pointers. Use malloc function to assign dynamic memory. This Question is done by CS20B1044 Avinash R Changrani */ #include<stdio.h> #include<stdlib.h> // Defining the Structure struct student { char *student_name; int age; char roll_no[20]; char *address; } ; void main() { char temp; struct student s; // Using malloc to allocate memory dynamically s.student_name = (char*)malloc(50*sizeof(char)); s.address = (char*)malloc(100*sizeof(char)); // Getting information from User and storing it printf("Enter information about yourself:\n"); printf("Enter name: \n"); scanf("%[^\n]", s.student_name); printf("Enter age: \n"); scanf("%d", &s.age); printf("Enter roll number: \n"); scanf("%s", s.roll_no); printf("Enter address: \n"); scanf("%c",&temp); scanf("%[^\n]", s.address); // Printing the Information stored printf("Information about the student : \n"); printf("Name: %s \n", s.student_name); printf("Age: %d\n", s.age); printf("Roll number: %s\n", s.roll_no); printf("Address: %s \n", s.address); }
the_stack_data/657183.c
/* * Hazard pointers are a mechanism for protecting objects in memory from * being deleted by other threads while in use. This allows safe lock-free * data structures. */ #include <assert.h> #include <inttypes.h> #include <stdalign.h> #include <stdatomic.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <threads.h> #define HP_MAX_THREADS 128 #define HP_MAX_HPS 5 /* This is named 'K' in the HP paper */ #define CLPAD (128 / sizeof(uintptr_t)) #define HP_THRESHOLD_R HP_MAX_THREADS*3 /* This is named 'R' in the HP paper */ /* Maximum number of retired objects per thread */ #define HP_MAX_RETIRED (HP_MAX_THREADS * HP_MAX_HPS) #define TID_UNKNOWN -1 typedef struct { int size; uintptr_t *list; } retirelist_t; typedef struct list_hp list_hp_t; typedef void(list_hp_deletefunc_t)(void *); struct list_hp { int max_hps; alignas(128) atomic_uintptr_t *hp[HP_MAX_THREADS]; alignas(128) retirelist_t *rl[HP_MAX_THREADS * CLPAD]; list_hp_deletefunc_t *deletefunc; }; static thread_local int tid_v = TID_UNKNOWN; static atomic_int_fast32_t tid_v_base = ATOMIC_VAR_INIT(0); static inline int tid(void) { if (tid_v == TID_UNKNOWN) { tid_v = atomic_fetch_add(&tid_v_base, 1); assert(tid_v < HP_MAX_THREADS); } return tid_v; } /* Create a new hazard pointer array of size 'max_hps' (or a reasonable * default value if 'max_hps' is 0). The function 'deletefunc' will be * used to delete objects protected by hazard pointers when it becomes * safe to retire them. */ list_hp_t *list_hp_new(size_t max_hps, list_hp_deletefunc_t *deletefunc) { list_hp_t *hp = aligned_alloc(128, sizeof(*hp)); assert(hp); if (max_hps == 0) max_hps = HP_MAX_HPS; *hp = (list_hp_t){.max_hps = max_hps, .deletefunc = deletefunc}; for (int i = 0; i < HP_MAX_THREADS; i++) { hp->hp[i] = calloc(CLPAD * 2, sizeof(hp->hp[i][0])); hp->rl[i * CLPAD] = calloc(1, sizeof(*hp->rl[0])); for (int j = 0; j < hp->max_hps; j++) atomic_init(&hp->hp[i][j], 0); hp->rl[i * CLPAD]->list = calloc(HP_MAX_RETIRED, sizeof(uintptr_t)); } return hp; } /* Destroy a hazard pointer array and clean up all objects protected * by hazard pointers. */ void list_hp_destroy(list_hp_t *hp) { for (int i = 0; i < HP_MAX_THREADS; i++) { free(hp->hp[i]); retirelist_t *rl = hp->rl[i * CLPAD]; for (int j = 0; j < rl->size; j++) { void *data = (void *) rl->list[j]; hp->deletefunc(data); } free(rl->list); free(rl); } free(hp); } /* Clear all hazard pointers in the array for the current thread. * Progress condition: wait-free bounded (by max_hps) */ void list_hp_clear(list_hp_t *hp) { for (int i = 0; i < hp->max_hps; i++) atomic_store_explicit(&hp->hp[tid()][i], 0, memory_order_release); } /* This returns the same value that is passed as ptr. * Progress condition: wait-free population oblivious. */ uintptr_t list_hp_protect_ptr(list_hp_t *hp, int ihp, uintptr_t ptr) { atomic_store(&hp->hp[tid()][ihp], ptr); return ptr; } /* Same as list_hp_protect_ptr(), but explicitly uses memory_order_release. * Progress condition: wait-free population oblivious. */ uintptr_t list_hp_protect_release(list_hp_t *hp, int ihp, uintptr_t ptr) { atomic_store_explicit(&hp->hp[tid()][ihp], ptr, memory_order_release); return ptr; } int cmpfunc (const void * a, const void * b) { return ( *(int*)a - *(int*)b ); } /* Retire an object that is no longer in use by any thread, calling * the delete function that was specified in list_hp_new(). * * Progress condition: wait-free bounded (by the number of threads squared) */ void list_hp_retire(list_hp_t *hp, uintptr_t ptr) { retirelist_t *rl = hp->rl[tid() * CLPAD]; rl->list[rl->size++] = ptr; assert(rl->size < HP_MAX_RETIRED); if (rl->size < HP_THRESHOLD_R) return; unsigned int array[HP_MAX_THREADS*3]; int len = 0; for (int itid = 0; itid < HP_MAX_THREADS; itid++) { for (int ihp = hp->max_hps - 1; ihp >= 0; ihp--) { array[len++] = atomic_load(&hp->hp[itid][ihp]); } } qsort(array, len, sizeof(unsigned int), cmpfunc); for (size_t iret = 0; iret < rl->size; iret++) { uintptr_t obj = rl->list[iret]; if(bsearch(&obj,array,len,sizeof(unsigned int),cmpfunc)) { size_t bytes = (rl->size - iret) * sizeof(rl->list[0]); memmove(&rl->list[iret], &rl->list[iret + 1], bytes); rl->size--; hp->deletefunc((void*) obj); } } } #include <pthread.h> #define N_ELEMENTS 128 #define N_THREADS (64) #define MAX_THREADS 128 static atomic_uint_fast32_t deletes = 0, inserts = 0; enum { HP_NEXT = 0, HP_CURR = 1, HP_PREV }; #define is_marked(p) (bool) ((uintptr_t)(p) &0x01) #define get_marked(p) ((uintptr_t)(p) | (0x01)) #define get_unmarked(p) ((uintptr_t)(p) & (~0x01)) #define get_marked_node(p) ((list_node_t *) get_marked(p)) #define get_unmarked_node(p) ((list_node_t *) get_unmarked(p)) typedef uintptr_t list_key_t; typedef struct list_node { alignas(128) uint32_t magic; alignas(128) atomic_uintptr_t next; list_key_t key; } list_node_t; /* Per list variables */ typedef struct list { atomic_uintptr_t head, tail; list_hp_t *hp; } list_t; #define LIST_MAGIC (0xDEADBEAF) list_node_t *list_node_new(list_key_t key) { list_node_t *node = aligned_alloc(128, sizeof(*node)); assert(node); *node = (list_node_t){.magic = LIST_MAGIC, .key = key}; (void) atomic_fetch_add(&inserts, 1); return node; } void list_node_destroy(list_node_t *node) { if (!node) return; assert(node->magic == LIST_MAGIC); free(node); (void) atomic_fetch_add(&deletes, 1); } static void __list_node_delete(void *arg) { list_node_t *node = (list_node_t *) arg; list_node_destroy(node); } static bool __list_find(list_t *list, list_key_t *key, atomic_uintptr_t **par_prev, list_node_t **par_curr, list_node_t **par_next) { atomic_uintptr_t *prev = NULL; list_node_t *curr = NULL, *next = NULL; try_again: prev = &list->head; curr = (list_node_t *) atomic_load(prev); (void) list_hp_protect_ptr(list->hp, HP_CURR, (uintptr_t) curr); if (atomic_load(prev) != get_unmarked(curr)) goto try_again; while (true) { if (!get_unmarked_node(curr)) return false; next = (list_node_t *) atomic_load(&get_unmarked_node(curr)->next); (void) list_hp_protect_ptr(list->hp, HP_NEXT, get_unmarked(next)); if (atomic_load(&get_unmarked_node(curr)->next) != (uintptr_t) next) break; if (get_unmarked(next) == atomic_load((atomic_uintptr_t *) &list->tail)) break; if (atomic_load(prev) != get_unmarked(curr)) goto try_again; if (get_unmarked_node(next) == next) { if (!(get_unmarked_node(curr)->key < *key)) { *par_curr = curr; *par_prev = prev; *par_next = next; return *key == get_marked_node(curr)->key; } prev = &get_unmarked_node(curr)->next; (void) list_hp_protect_release(list->hp, HP_PREV, get_unmarked(curr)); } else { uintptr_t tmp = get_unmarked(curr); if (!atomic_compare_exchange_strong(prev, &tmp, get_unmarked(next))) goto try_again; list_hp_retire(list->hp, get_unmarked(curr)); } curr = next; (void) list_hp_protect_release(list->hp, HP_CURR, get_unmarked(next)); } *par_curr = curr; *par_prev = prev; *par_next = next; return false; } bool list_insert(list_t *list, list_key_t key) { list_node_t *curr = NULL, *next = NULL; atomic_uintptr_t *prev = NULL; list_node_t *node = list_node_new(key); while (true) { if (__list_find(list, &key, &prev, &curr, &next)) { list_node_destroy(node); list_hp_clear(list->hp); return false; } atomic_store_explicit(&node->next, (uintptr_t) curr, memory_order_relaxed); uintptr_t tmp = get_unmarked(curr); if (atomic_compare_exchange_strong(prev, &tmp, (uintptr_t) node)) { list_hp_clear(list->hp); return true; } } } bool list_delete(list_t *list, list_key_t key) { list_node_t *curr, *next; atomic_uintptr_t *prev; while (true) { if (!__list_find(list, &key, &prev, &curr, &next)) { list_hp_clear(list->hp); return false; } uintptr_t tmp = get_unmarked(next); if (!atomic_compare_exchange_strong(&curr->next, &tmp, get_marked(next))) continue; tmp = get_unmarked(curr); if (atomic_compare_exchange_strong(prev, &tmp, get_unmarked(next))) { list_hp_clear(list->hp); list_hp_retire(list->hp,get_unmarked(curr)); } else { list_hp_clear(list->hp); } return true; } } list_t *list_new(void) { list_t *list = calloc(1, sizeof(*list)); assert(list); list_node_t *head = list_node_new(0), *tail = list_node_new(UINTPTR_MAX); assert(head), assert(tail); list_hp_t *hp = list_hp_new(3, __list_node_delete); atomic_init(&head->next, (uintptr_t) tail); *list = (list_t){.hp = hp}; atomic_init(&list->head, (uintptr_t) head); atomic_init(&list->tail, (uintptr_t) tail); return list; } void list_destroy(list_t *list) { assert(list); list_node_t *prev = (list_node_t *) atomic_load(&list->head); list_node_t *node = (list_node_t *) atomic_load(&prev->next); while (node) { list_node_destroy(prev); prev = node; node = (list_node_t *) atomic_load(&prev->next); } list_node_destroy(prev); list_hp_destroy(list->hp); free(list); } static uintptr_t elements[MAX_THREADS + 1][N_ELEMENTS]; static void *insert_thread(void *arg) { list_t *list = (list_t *) arg; for (size_t i = 0; i < N_ELEMENTS; i++) (void) list_insert(list, (uintptr_t) &elements[tid()][i]); return NULL; } static void *delete_thread(void *arg) { list_t *list = (list_t *) arg; for (size_t i = 0; i < N_ELEMENTS; i++) (void) list_delete(list, (uintptr_t) &elements[tid()][i]); return NULL; } int main(void) { list_t *list = list_new(); pthread_t thr[N_THREADS]; for (size_t i = 0; i < N_THREADS; i++) pthread_create(&thr[i], NULL, (i & 1) ? delete_thread : insert_thread, list); for (size_t i = 0; i < N_THREADS; i++) pthread_join(thr[i], NULL); for (size_t i = 0; i < N_ELEMENTS; i++) { for (size_t j = 0; j < tid_v_base; j++) list_delete(list, (uintptr_t) &elements[j][i]); } list_destroy(list); fprintf(stderr, "inserts = %zu, deletes = %zu\n", atomic_load(&inserts), atomic_load(&deletes)); return 0; }
the_stack_data/220456490.c
/* Test for re_search_2. Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <[email protected]>, 2001. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <locale.h> #include <stdio.h> #include <string.h> #include <regex.h> int main (void) { struct re_pattern_buffer regex; const char *s; int match[3]; int result = 0; memset (&regex, '\0', sizeof (regex)); setlocale (LC_ALL, "C"); s = re_compile_pattern ("ab[cde]", 7, &regex); if (s != NULL) { puts ("re_compile_pattern returned non-NULL value"); result = 1; } else { match[0] = re_search_2 (&regex, "xyabez", 6, "", 0, 1, 5, NULL, 6); match[1] = re_search_2 (&regex, NULL, 0, "abc", 3, 0, 3, NULL, 3); match[2] = re_search_2 (&regex, "xya", 3, "bd", 2, 2, 3, NULL, 5); if (match[0] != 2 || match[1] != 0 || match[2] != 2) { printf ("re_search_2 returned %d,%d,%d, expected 2,0,2\n", match[0], match[1], match[2]); result = 1; } else puts (" -> OK"); } return result; }
the_stack_data/50339.c
#include <stdio.h> int main() { char harf; printf("Harfni kiriting: \n"); scanf("%c", &harf); if (harf>64 && harf<91) { harf+=32; } else if (harf>96 && harf<123) { harf-=32; } printf("Harf = %c\n", harf); return 0; }
the_stack_data/116804.c
#include <stdlib.h> #include <stdio.h> int main() { int *ptr; int x = 5; ptr = NULL; x = *ptr; return 0; }
the_stack_data/175142336.c
// RUN: %clang_cc1 -triple powerpc-unknown-linux-gnu -fsyntax-only -verify -fcf-protection=branch %s // RUN: %clang_cc1 -triple arm-unknown-linux-gnu -fsyntax-only -verify -fcf-protection=branch %s // RUN: %clang_cc1 -triple arm-unknown-linux-gnu -fsyntax-only -verify %s void __attribute__((nocf_check)) foo(void); // expected-warning-re{{{{((unknown attribute 'nocf_check' ignored)|('nocf_check' attribute ignored; use -fcf-protection to enable the attribute))}}}}
the_stack_data/740332.c
/* { dg-do compile } */ /* { dg-additional-options "-Wno-pedantic -Wno-long-long -m64" } */ /* Comples arg types. All these should be in 2 registers. */ /* { dg-final { scan-assembler-times ".extern .func dcl_acc \\(.param.u32 %\[_a-z0-9\]*, .param.u32 %\[_a-z0-9\]*\\);" 1 } } */ void dcl_acc (_Complex char); /* { dg-final { scan-assembler-times ".extern .func dcl_acs \\(.param.u32 %\[_a-z0-9\]*, .param.u32 %\[_a-z0-9\]*\\);" 1 } } */ void dcl_acs (_Complex short); /* { dg-final { scan-assembler-times ".extern .func dcl_aci \\(.param.u32 %\[_a-z0-9\]*, .param.u32 %\[_a-z0-9\]*\\);" 1 } } */ void dcl_aci (_Complex int); /* { dg-final { scan-assembler-times ".extern .func dcl_acll \\(.param.u64 %\[_a-z0-9\]*, .param.u64 %\[_a-z0-9\]*\\);" 1 } } */ void dcl_acll (_Complex long); /* { dg-final { scan-assembler-times ".extern .func dcl_acf \\(.param.f32 %\[_a-z0-9\]*, .param.f32 %\[_a-z0-9\]*\\);" 1 } } */ void dcl_acf (_Complex float); /* { dg-final { scan-assembler-times ".extern .func dcl_acd \\(.param.f64 %\[_a-z0-9\]*, .param.f64 %\[_a-z0-9\]*\\);" 1 } } */ void dcl_acd (_Complex double); #define M(T,r,i) ({_Complex T x; __real__ (x) = (r), __imag__(x) == (i); x; }) void test_1 (void) { dcl_acc (M (char, 1, 2)); dcl_acs (M (short, 3, 4)); dcl_aci (M (int, 5, 6)); dcl_acll (M (long long, 7, 8)); dcl_acf (M (float, 9, 10)); dcl_acd (M (double, 11, 12)); } /* { dg-final { scan-assembler-times ".visible .func dfn_acc \\(.param.u32 %\[_a-z0-9\]*, .param.u32 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */ void dfn_acc (_Complex char c) { } /* { dg-final { scan-assembler-times ".visible .func dfn_acs \\(.param.u32 %\[_a-z0-9\]*, .param.u32 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */ void dfn_acs (_Complex short s) { } /* { dg-final { scan-assembler-times ".visible .func dfn_aci \\(.param.u32 %\[_a-z0-9\]*, .param.u32 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */ void dfn_aci (_Complex int i) { } /* { dg-final { scan-assembler-times ".visible .func dfn_acll \\(.param.u64 %\[_a-z0-9\]*, .param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */ void dfn_acll (_Complex long long ll) { } /* { dg-final { scan-assembler-times ".visible .func dfn_acf \\(.param.f32 %\[_a-z0-9\]*, .param.f32 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */ void dfn_acf (_Complex float f) { } /* { dg-final { scan-assembler-times ".visible .func dfn_acd \\(.param.f64 %\[_a-z0-9\]*, .param.f64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */ void dfn_acd (_Complex double d) { }
the_stack_data/895518.c
#include <sys/types.h> #include <stdint.h> #include <stddef.h> #include "wchar.h" #undef KEY #if defined(__i386) # define KEY '_','_','i','3','8','6' #elif defined(__x86_64) # define KEY '_','_','x','8','6','_','6','4' #elif defined(__ppc__) # define KEY '_','_','p','p','c','_','_' #elif defined(__ppc64__) # define KEY '_','_','p','p','c','6','4','_','_' #endif #define SIZE (sizeof(mbstate_t)) char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[', ('0' + ((SIZE / 10000)%10)), ('0' + ((SIZE / 1000)%10)), ('0' + ((SIZE / 100)%10)), ('0' + ((SIZE / 10)%10)), ('0' + (SIZE % 10)), ']', #ifdef KEY ' ','k','e','y','[', KEY, ']', #endif '\0'}; #ifdef __CLASSIC_C__ int main(argc, argv) int argc; char *argv[]; #else int main(int argc, char *argv[]) #endif { int require = 0; require += info_size[argc]; (void)argv; return require; }
the_stack_data/237642331.c
/* GIMP RGBA C-Source image dump (Get Ready Text 95x26.c) */ #define TMP_WIDTH (95) #define TMP_HEIGHT (26) #define TMP_BYTES_PER_PIXEL (2) /* 2:RGB16, 3:RGB, 4:RGBA */ #define TMP_PIXEL_DATA ((unsigned char*) TMP_pixel_data) static const unsigned char TMP_pixel_data[95 * 26 * 2 + 1] = ("\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377T\070G\377T\070G\377T\070G\377" "T\070G\377T\070G\377T\070G\377T\070G\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\310Q" "\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\310Q\310Q\310Q\310Q\310Q\310" "Q\310Q\310Q\377\377\377\377\377\377\377\377\310Q\310Q\310Q\310Q\310Q\310Q" "\310Q\310Q\310Q\310Q\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\310Q" "\310Q\310Q\310Q\310Q\310Q\310Q\310Q\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\377\377\377\377\377" "\377\377\377\377\377\310Q\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\310Q\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\310Q\377\377\377\377\377\377\377\377\377\377" "\377\377\310Q\377\377\377\377\377\377\377\377\310Q\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\310Q\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\310Q\377\377\377\377\377\377\377\377\377\377\377\377" "\310Q\377\377\377\377\377\377\377\377\377\377\377\377\377\377\310Q\377\377" "\377\377\377\377\377\377\377\377\377\377\310Q\377\377\377\377\377\377\377" "\377\310Q\377\377\377\377\313^\313^\313^\313^\313^\313^\313^\377\377\310Q" "\310Q\310Q\310Q\310Q\310Q\310Q\377\377\377\377\377\377\310Q\377\377\313^\313" "^\313^\313^\377\377\310Q\377\377\377\377\377\377\377\377\310Q\377\377\313" "^\313^\313^\313^\313^\313^\313^\377\377\377\377\310Q\377\377\377\377\310Q" "\310Q\310Q\310Q\310Q\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\310" "Q\377\377\313^\313^\313^\313^\377\377\310Q\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\310Q\377\377\313^\313^\313^\313^\377\377\310Q\377" "\377\377\377\377\377\310Q\377\377\377\377\313^\313^\313^\313^\313^\313^\313" "^\313^\377\377\310Q\310Q\377\377\377\377\377\377\377\377\377\377\310Q\377" "\377\377\377\310Q\377\377\313^\313^\313^\313^\377\377\310Q\377\377\377\377" "\377\377\377\377\310Q\377\377\313^\313^\313^\313^\313^\313^\313^\313^\377" "\377\377\377\310Q\310Q\377\377\377\377\377\377\377\377\377\377\310Q\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\310Q\377\377\313^\313^\313^\313^\377" "\377\310Q\377\377\377\377\377\377\377\377\377\377\377\377\377\377\310Q\377" "\377\313^\313^\313^\313^\377\377\310Q\377\377\377\377\377\377\310Q\377\377" "\313^\313^\313^\313^\313^\313^\313^\313^\313^\377\377\310Q\377\377\377\377" "\313^\313^\313^\377\377\377\377\310Q\377\377\310Q\377\377\313^\313^\313^\313" "^\377\377\310Q\377\377\377\377\377\377\377\377\310Q\377\377\313^\313^\313" "^\313^\313^\313^\313^\313^\313^\377\377\310Q\377\377\377\377\313^\313^\313" "^\377\377\377\377\310Q\377\377\377\377\377\377\310Q\310Q\310Q\310Q\310Q\310" "Q\310Q\310Q\310Q\377\377\377\377\310Q\377\377\313^\313^\313^\313^\377\377" "\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\377\377\313^\313^\313^\313^" "\377\377\310Q\377\377\377\377\377\377\310Q\377\377\313^\313^\313^\313^I\005" "I\005I\005I\005I\005\377\377\377\377\377\377\313^\313^\313^\313^\313^\377\377\377" "\377\310Q\310Q\377\377\313^\313^\313^\313^\377\377\310Q\310Q\310Q\377\377" "\377\377\310Q\377\377\313^\313^\313^\313^I\005\313^\313^\313^\313^\377\377\377" "\377\377\377\313^\313^\313^\313^\313^\377\377\377\377\310Q\377\377\310Q\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\310Q\310Q\310" "Q\310Q\377\377\313^\313^\313^\313^\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\313^\313^\313^\313^\377\377" "\310Q\377\377\377\377\377\377\310Q\377\377\313^\313^\313^\313^\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\313^\313^\313^\313^\313^\313" "^\313^\377\377\377\377\377\377\377\377\313^\313^\313^\313^\377\377\377\377" "\377\377\310Q\377\377\377\377\310Q\377\377\313^\313^\313^\313^\377\377\313" "^\313^\313^\313^\377\377\377\377\313^\313^\313^\313^\313^\313^\313^\377\377" "\377\377\310Q\377\377\377\377\313^\313^\313^\313^\313^\313^\377\377\310Q\377" "\377\377\377\377\377\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313" "^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\310Q\377" "\377\377\377\377\377\310Q\377\377\313^\313^\313^\313^\377\377\377\377\377" "\377\377\377\377\377\377\377\313^\313^\313^\313^\313^\313^\313^\313^\313^" "\377\377\313^\313^\313^\313^\313^\313^\313^\313^\377\377\310Q\377\377\377" "\377\310Q\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377" "\313^\313^\313^\313^\313^\313^\313^\313^\313^\377\377\377\377\377\377\313" "^\313^\313^\313^\313^\313^\313^\377\377\377\377\377\377\313^\313^\313^\313" "^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377" "\377\313^\313^\313^\313^\377\377\310Q\377\377\377\377\377\377\310Q\377\377" "\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313" "^I\005\313^\313^\313^\313^\377\377\313^\313^\313^\313^\313^\313^\313^\313^\377" "\377\310Q\377\377\377\377\310Q\377\377\313^\313^\313^\313^\377\377\313^\313" "^\313^\313^\377\377\313^\313^\313^\313^I\005\313^\313^\313^\313^\377\377\377" "\377\313^\313^\313^\313^\313^\313^\313^\313^\377\377\377\377\313^\313^\313" "^\313^\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313^\313" "^\313^\377\377\313^\313^\313^\313^\377\377\310Q\377\377\377\377\377\377\310" "Q\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313" "^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\313^\313" "^\313^\313^\377\377\310Q\377\377\377\377\310Q\377\377\313^\313^\313^\313^" "\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313" "^\313^\313^\377\377\313^\313^\313^\313^\313^\313^\313^\313^\313^\377\377\313" "^\313^\313^\313^\313^\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377" "\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\310Q\377\377" "\377\377\377\377\310Q\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313" "^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377I\005I\005\313" "^\313^\313^\313^I\005I\005\377\377\310Q\377\377\377\377\310Q\377\377\313^\313" "^\313^\313^\313^\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\313" "^\313^\313^\313^\377\377\313^\313^\313^\313^I\005\313^\313^\313^\313^\377\377" "\313^\313^\313^\313^I\005\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377" "\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\310Q\377\377" "\377\377\377\377\310Q\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313" "^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\377\377" "\377\377\313^\313^\313^\313^\377\377\377\377\377\377\310Q\377\377\377\377" "\310Q\377\377\313^\313^\313^\313^\313^\313^\313^\313^\313^\377\377\313^\313" "^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377" "\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313" "^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313" "^\313^\313^\377\377\310Q\377\377\377\377\377\377\310Q\377\377\313^\313^\313" "^\313^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\313^\313^\313" "^\313^\313^\377\377\310Q\377\377\313^\313^\313^\313^\377\377\310Q\310Q\310" "Q\377\377\377\377\310Q\377\377\313^\313^\313^\313^\313^\313^\313^\313^I\005" "\377\377\313^\313^\313^\313^\313^\313^\313^\313^\313^\377\377\313^\313^\313" "^\313^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\313" "^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377" "\377I\005I\005I\005I\005\377\377\310Q\377\377\377\377\377\377\310Q\377\377\313^\313" "^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\313^\313" "^\313^\313^\313^\377\377\310Q\377\377\313^\313^\313^\313^\377\377\310Q\310" "Q\310Q\377\377\377\377\310Q\377\377\313^\313^\313^\313^\313^\313^\313^I\005" "\377\377\377\377\313^\313^\313^\313^\313^\313^\313^\313^\313^\377\377\313" "^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377" "\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\313^\313^\313^\313^\313" "^\377\377\377\377\377\377\377\377\377\377\377\377\310Q\377\377\377\377\377" "\377\310Q\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377" "\313^\313^\313^\313^\313^I\005I\005I\005I\005\377\377\310Q\377\377\313^\313^\313^" "\313^\377\377\377\377\377\377\310Q\377\377\377\377\310Q\377\377\313^\313^" "\313^\313^\313^\313^\313^\377\377\377\377\377\377\313^\313^\313^\313^\313" "^I\005I\005I\005I\005\377\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377" "\377\313^\313^\313^\313^\377\377\313^\313^\313^\313^\377\377I\005\313^\313^" "\313^\313^\313^\313^\313^\313^\377\377\377\377\377\377\377\377\377\377\377" "\377\310Q\377\377\377\377\377\377\310Q\377\377\313^\313^\313^\313^\313^\313" "^\313^\313^\313^\377\377\313^\313^\313^\313^\313^\377\377\377\377\377\377" "\377\377\377\377\310Q\377\377\313^\313^\313^\313^\313^\313^\377\377\310Q\377" "\377\377\377\310Q\377\377\313^\313^\313^\313^\313^\313^\313^\377\377\377\377" "\377\377\313^\313^\313^\313^\313^\377\377\377\377\377\377\377\377\377\377" "\313^\313^\313^\313^\313^\313^\313^\313^\313^\377\377\313^\313^\313^\313^" "\313^\313^\313^\313^\313^\377\377\377\377I\005\313^\313^\313^\313^\313^\313" "^\313^\377\377\313^\313^\313^\313^\377\377\310Q\377\377\377\377\377\377\310" "Q\377\377I\005\313^\313^\313^\313^\313^\313^\313^\313^\377\377I\005\313^\313^" "\313^\313^\377\377\310Q\310Q\310Q\310Q\310Q\377\377I\005\313^\313^\313^\313" "^\313^\377\377\310Q\377\377\377\377\310Q\377\377\313^\313^\313^\313^\377\377" "\313^\313^\313^\377\377\377\377I\005\313^\313^\313^\313^\377\377\310Q\310Q\310" "Q\377\377I\005\313^\313^\313^\313^\313^\313^\313^\313^\377\377I\005\313^\313^" "\313^\313^\313^\313^\313^\313^\377\377\377\377\377\377I\005I\005I\005\313^\313^" "\313^\313^\377\377\313^\313^\313^\313^\377\377\310Q\377\377\377\377\377\377" "\310Q\377\377\377\377I\005\313^\313^\313^\313^\313^\313^\313^\377\377\377\377" "I\005\313^\313^\313^\377\377\310Q\377\377\377\377\377\377\310Q\377\377\377\377" "I\005\313^\313^\313^\313^\377\377\310Q\377\377\377\377\310Q\377\377\313^\313" "^\313^\313^\377\377\313^\313^\313^\313^\377\377\377\377I\005\313^\313^\313^" "\377\377\310Q\377\377\310Q\377\377\377\377I\005\313^\313^\313^\313^\313^\313" "^\313^\377\377\377\377I\005\313^\313^\313^\313^\313^\313^\313^\377\377\310Q" "\377\377\377\377\377\377\377\377\313^\313^\313^\313^\377\377\313^\313^\313" "^\313^\377\377\310Q\377\377\377\377\377\377\377\377\310Q\377\377\377\377I" "\005I\005I\005I\005I\005I\005I\005\377\377\377\377\377\377I\005I\005I\005\377\377\310Q\377\377" "\377\377\377\377\377\377\310Q\377\377\377\377I\005I\005I\005I\005\377\377\310Q\377" "\377\377\377\310Q\377\377I\005I\005I\005I\005\377\377I\005I\005I\005I\005\377\377\377\377" "\377\377I\005I\005I\005\377\377\310Q\377\377\377\377\310Q\377\377\377\377I\005I\005" "I\005I\005I\005I\005I\005\377\377\377\377\377\377I\005I\005I\005I\005I\005I\005I\005\377\377\310Q" "\310Q\377\377\377\377\377\377\313^\313^\313^\313^\377\377I\005I\005I\005I\005\377" "\377\310Q\377\377\377\377\377\377\377\377\377\377\310Q\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\310Q\377\377\377\377" "\377\377\377\377\377\377\310Q\377\377\377\377\377\377\377\377\377\377\310" "Q\377\377\377\377\377\377\377\377\377\377\377\377\310Q\377\377\377\377\310" "Q\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\310Q\377\377\377\377\377\377\377\377\377\377\310Q\377\377" "\377\377\377\377\310Q\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\310Q\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\310Q\310Q\377\377\313^\313^\313^\313^\313^\313^\377" "\377\377\377\377\377\377\377\377\377\377\377\310Q\377\377\377\377\377\377" "\377\377\377\377\377\377\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310" "Q\310Q\310Q\310Q\310Q\310Q\310Q\377\377\377\377\377\377\377\377\377\377\377" "\377\310Q\310Q\310Q\310Q\310Q\310Q\310Q\377\377\377\377\377\377\310Q\310Q" "\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310" "Q\310Q\377\377\377\377\377\377\377\377\310Q\310Q\310Q\310Q\310Q\310Q\310Q" "\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\310Q\377" "\377\313^\313^\313^\313^\313^I\005\377\377\310Q\310Q\310Q\310Q\310Q\310Q\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\310Q\377\377\313^\313^\313^\313^I\005\377\377\377" "\377\310Q\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\310Q\377\377I\005I\005I\005I\005\377\377\377\377\310Q\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\310Q\377\377" "\377\377\377\377\377\377\377\377\377\377\310Q\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\310Q\310Q\310" "Q\310Q\310Q\310Q\310Q\377\377\377\377\377\377\377\377\377\377\377\377\377" "\377\377\377\377\377");
the_stack_data/20451449.c
/* gmtime - command line implementation of gmtime() C library function */ /* Copyright (C) 2013 The Regents of the University of California * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ #include <stdio.h> #include <time.h> #include <unistd.h> #include <stdlib.h> void usage() { fprintf(stderr,"gmtime - convert unix timestamp to date string\n"); fprintf(stderr,"usage: gmtime <time stamp>\n"); fprintf(stderr,"\t<time stamp> - integer 0 to 2147483647\n"); } int main( int argc, char **argv) { int timeStamp; time_t timep; struct tm *tm; if (argc != 2){ usage(); exit(255);} timeStamp = atoi(argv[1]); timep = (time_t) timeStamp; tm = gmtime(&timep); printf("%d-%02d-%02d %02d:%02d:%02d %ld\n", 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, (unsigned long)timep); return(0); }
the_stack_data/88075.c
#include <stdio.h> #include <math.h> int main(){ int i; printf("Enter situation: "); scanf("%d", &i); printf("%d", (i % 10000) / 1000); return 0; }
the_stack_data/27837.c
#include <stdio.h> int main(){ int matriz[3][4]; int i,j; int sum; for( i = 0; i < 3; i++){ for( j = 0; j <4 ; j++){ scanf("%d",&matriz[i][j]); fflush(stdin); } } sum = 0; for(i = 0; i < 3; i++){ for( j = 0; j <4; j++){ sum += matriz[i][j]; } printf("A soma da linha %d eh %d\n", i, sum); sum = 0; } return 0; }
the_stack_data/61075033.c
#include <stdbool.h> typedef int Boolean; bool x(bool *); Boolean y(Boolean *);
the_stack_data/22014135.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(){ printf("UNO\n"); fork(); printf("DUE\n"); exit(0); }
the_stack_data/68533.c
/*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * %sccs.include.redist.c% */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strncpy.c 8.1 (Berkeley) 06/04/93"; #endif /* LIBC_SCCS and not lint */ #include <sys/cdefs.h> #include <string.h> /* * Copy src to dst, truncating or null-padding to always copy n bytes. * Return dst. */ char * strncpy(dst, src, n) char *dst; const char *src; register size_t n; { if (n != 0) { register char *d = dst; register const char *s = src; do { if ((*d++ = *s++) == 0) { /* NUL pad the remaining n-1 bytes */ while (--n != 0) *d++ = 0; break; } } while (--n != 0); } return (dst); }
the_stack_data/307596.c
extern char* malloc(int); void main(){ int *x; int *y; int i; int z; y = (int *) malloc(100); x = y; i = 0; for (; i < 100; i++){ validptr(x); *x = 0; x++; } i = 0; x = y; for (; i < 100; i++){ z = *x; assert(z >= 0); x++; } return 0; }
the_stack_data/31387945.c
// @klee unsigned long fibonacci(unsigned short n) { if (n == 0) { return 0; } if (n == 1) { return 1; } return fibonacci(n - 1) + fibonacci(n - 2); }
the_stack_data/109948.c
typedef int x; void f(void) { x:; }
the_stack_data/165765408.c
//quartz2962_37437/_tests/_group_6/_test_9.c //+1.9207E-323 5 5 -0.0 -1.3629E20 +1.7272E-134 -1.6158E-311 -1.5581E-323 +1.1476E0 -0.0 // /* This is a automatically generated test. Do not modify */ #include <stdio.h> #include <stdlib.h> #include <math.h> void compute(double comp, int var_1,int var_2,double var_3,double var_4,double var_5,double var_6,double var_7,double var_8,double var_9) { for (int i=0; i < var_1; ++i) { if ((long double)comp > (-1.0504E-306 * ((long double)var_3 * (long double)var_4))) { for (int i=0; i < var_2; ++i) { double tmp_1 = tanh(sqrt(var_5 * var_6 / var_7 * -1.7260E96)); comp = tmp_1 * var_8 - +0.0; comp = (+1.7213E306 + (+0.0 - var_9 - -1.1113E-71)); } } } printf("%.17g\n", comp); } double* initPointer(double v) { double *ret = (double*) malloc(sizeof(double)*10); for(int i=0; i < 10; ++i) ret[i] = v; return ret; } int main(int argc, char** argv) { /* Program variables */ double tmp_1 = atof(argv[1]); int tmp_2 = atoi(argv[2]); int tmp_3 = atoi(argv[3]); double tmp_4 = atof(argv[4]); double tmp_5 = atof(argv[5]); double tmp_6 = atof(argv[6]); double tmp_7 = atof(argv[7]); double tmp_8 = atof(argv[8]); double tmp_9 = atof(argv[9]); double tmp_10 = atof(argv[10]); compute(tmp_1,tmp_2,tmp_3,tmp_4,tmp_5,tmp_6,tmp_7,tmp_8,tmp_9,tmp_10); return 0; }
the_stack_data/168892425.c
/*************************************************************** * 4.1.6 Feladat(!) * * Olvasson be két számot * * Cserélje meg a két számot újabb változó létrehozása nélkül * ***************************************************************/ #include <stdio.h> int main() { int a, b; scanf("%d %d", &a, &b); a=a+b; b=a-b; a=a-b; printf("%d %d\n", a, b); return 0; }
the_stack_data/31388953.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pthread.h> // GLOBAL SCOPE int g = 0; // FUNCTION CAN BE CALLED BY ALL THREADS void *myThread(void *vargp) { // LOCAL SCOPE, scope of myThread and A LOCAL VARIABLE //int *myid = (int *) (size_t) vargp; // LOCAL SCOPE, scope of myThread and A LOCAL STATIC VARIABLE static int s = 0; // Change the static and the global variables ++s; ++g; // Print the argument (local variable), static (local) and global variable printf("vargp: %d, Static: %d, Global: %d\n", (int) vargp, ++s, ++g); return NULL; } int main() { pthread_attr_t attr; pthread_t posixThreadID; int i; int returnVal; int threadError; returnVal = pthread_attr_init(&attr); //assert(!returnVal); returnVal = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); //assert(!returnVal); // Create 3 THREADS for (i=0;i<3;i++) { //pthread_create(&tid, NULL, myThread, (void *) (size_t) i); threadError = pthread_create(&posixThreadID, &attr, &myThread, (void *) (size_t) i); //usleep(100*1000); } returnVal = pthread_attr_destroy(&attr); if (threadError != 0) { printf("threadError"); } //pthread_exit(NULL); return 0; }
the_stack_data/40263.c
void foobar() { int x; switch(x) { char *t, *tend; unsigned int t0; int variable_top_of_switch = 0; int a; int b; int c; case 0: break; default: variable_top_of_switch = 1; 50; 51; 52; 53; 54; } }
the_stack_data/67525.c
/* * APU emulation - The peTI-NESulator Project * apu.c * * Created by Manoël Trapier. * Copyright (c) 2002-2019 986-Studio. * */ /* Empty, for now */
the_stack_data/32949863.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> struct InputFileDetails { char *name; int size; char *buffer; } inputFileDetails; void writeRawFile(char *fname, int sectorCount, struct InputFileDetails *inputFileDetails); void readInputFile(struct InputFileDetails *inputFileDetails); void displayHelp(); int main(int argc, char *argv[]) { if (argc == 1) { displayHelp(); return 1; } int sectorCount = 2880; char *filename = NULL; int opt; printf("\nhoss-disk-builder v1.0\n"); while((opt = getopt(argc, argv, ":i:s:")) != -1) { switch(opt) { case 'i': inputFileDetails.name = optarg; break; case 's': sectorCount = atoi(optarg); if (sectorCount == 0) { printf("Invalid sector count\n"); return 1; } break; case ':': printf("option needs a value\n"); break; case '?': printf("unknown option: %c\n", optopt); break; } } // optind is for the extra arguments // which are not parsed int fileInd = 0; for(; optind < argc; optind++){ if (fileInd == 1) { printf("Too many parameters\n"); displayHelp(); return 1; } filename = argv[optind]; fileInd = 1; } if (!filename) { printf("Missing output filename\n"); displayHelp(); return 1; } printf(" Sector size: %i\n", 512); printf(" Sector count: %i\n", sectorCount); readInputFile(&inputFileDetails); if (inputFileDetails.size == -1) { return 1; } else if (!inputFileDetails.buffer) { printf("Unable to read input file %s\n", inputFileDetails.name); return 1; } writeRawFile(filename, sectorCount, &inputFileDetails); free(inputFileDetails.buffer); printf("\n"); return 0; } void writeRawFile(char *fname, int sectorCount, struct InputFileDetails *inputFileDetails) { printf("Creating file '%s'\n", fname); char *buff = malloc(512); for (int i = 0; i < 512; i++) { buff[i] = 0; } FILE *file; if ((file = fopen(fname, "wb"))) { // First write input file if (inputFileDetails->size > 0) { fwrite(inputFileDetails->buffer, sizeof(char), inputFileDetails->size, file); } int sectorsOccupied = (inputFileDetails->size / 512) + 1; int bytesRemainingInCurrent = (sectorsOccupied * 512) - inputFileDetails->size; fwrite(buff, sizeof(*buff), bytesRemainingInCurrent, file); for (int i = sectorsOccupied; i < sectorCount; i++) { fwrite(buff, sizeof(*buff), 512, file); } int size = ftell(file); printf(" Finale size: %i\n", size); fclose(file); } else { printf("Error: Unable to create file %s\n", fname); } free(buff); return; } void readInputFile(struct InputFileDetails *inputFileDetails) { inputFileDetails->buffer = NULL; FILE *file; if ((file = fopen(inputFileDetails->name, "rb"))) { fseek(file, 0L, SEEK_END); inputFileDetails->size = ftell(file); rewind(file); printf(" Input file: %s\n", inputFileDetails->name); printf(" Size: %i\n", inputFileDetails->size); inputFileDetails->buffer = malloc(inputFileDetails->size); fread(inputFileDetails->buffer, sizeof(char), inputFileDetails->size, file); fclose(file); } else { inputFileDetails->size = -1; printf("Error: Unable to read input file %s\n", inputFileDetails->name); } } void displayHelp() { printf("Usage: hdb -ifs <file>\n"); }
the_stack_data/165764780.c
#include <stdio.h> int test() { short x; x = 0; x = x + 1; if (x != 1) return 1; return 0; } int main () { int x; x = test(); printf("%d\n", x); return 0; }
the_stack_data/646351.c
#include<stdio.h> int main(){ int a=1,b=1,m,n; scanf("%d%d",&m,&n) ; if(m==n){ printf("1"); return 0;} if(n<m-n) n=n; else n=n-m; if( n == 0 ) return 1; for( int i = m ; i >=m-n+1 ; i-- ) a = a*i; for( int i = 1 ; i <= n ; i++ ) b = b*i; printf("%d",a/b); }
the_stack_data/1136403.c
/* Copyright (c) 2018, Alexey Frunze 2-clause BSD license. */ #ifdef _WINDOWS asm("extern ___GetEnvironmentVariableA\n" "global _GetEnvironmentVariableA\n" "section .text\n" "_GetEnvironmentVariableA:\n" "jmp ___GetEnvironmentVariableA"); #endif
the_stack_data/28821.c
/* BLIS An object-based framework for developing high-performance BLAS-like libraries. Copyright (C) 2014, The University of Texas at Austin Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of The University of Texas at Austin nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Guard the function definitions so that they are only compiled when // #included from files that define the typed API macros. #ifdef BLIS_ENABLE_TAPI // // Define BLAS-like interfaces with typed operands. // #undef GENTFUNC #define GENTFUNC( ctype, ch, opname, kername, kerid ) \ \ void PASTEMAC2(ch,opname,EX_SUF) \ ( \ doff_t diagoffx, \ diag_t diagx, \ trans_t transx, \ dim_t m, \ dim_t n, \ ctype* x, inc_t rs_x, inc_t cs_x, \ ctype* y, inc_t rs_y, inc_t cs_y \ BLIS_TAPI_EX_PARAMS \ ) \ { \ bli_init_once(); \ \ BLIS_TAPI_EX_DECLS \ \ const num_t dt = PASTEMAC(ch,type); \ \ ctype* x1; \ ctype* y1; \ conj_t conjx; \ dim_t n_elem; \ dim_t offx, offy; \ inc_t incx, incy; \ \ if ( bli_zero_dim2( m, n ) ) return; \ \ if ( bli_is_outside_diag( diagoffx, transx, m, n ) ) return; \ \ /* Determine the distance to the diagonals, the number of diagonal elements, and the diagonal increments. */ \ bli_set_dims_incs_2d \ ( \ diagoffx, transx, \ m, n, rs_x, cs_x, rs_y, cs_y, \ &offx, &offy, &n_elem, &incx, &incy \ ); \ \ conjx = bli_extract_conj( transx ); \ \ if ( bli_is_nonunit_diag( diagx ) ) \ { \ x1 = x + offx; \ y1 = y + offy; \ } \ else /* if ( bli_is_unit_diag( diagx ) ) */ \ { \ /* Simulate a unit diagonal for x with a zero increment over a unit scalar. */ \ x1 = PASTEMAC(ch,1); \ incx = 0; \ y1 = y + offy; \ } \ \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ PASTECH2(ch,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ conjx, \ n_elem, \ x1, incx, \ y1, incy, \ cntx \ ); \ } INSERT_GENTFUNC_BASIC2( addd, addv, BLIS_ADDV_KER ) INSERT_GENTFUNC_BASIC2( copyd, copyv, BLIS_COPYV_KER ) INSERT_GENTFUNC_BASIC2( subd, subv, BLIS_SUBV_KER ) #undef GENTFUNC #define GENTFUNC( ctype, ch, opname, kername, kerid ) \ \ void PASTEMAC2(ch,opname,EX_SUF) \ ( \ doff_t diagoffx, \ diag_t diagx, \ trans_t transx, \ dim_t m, \ dim_t n, \ ctype* alpha, \ ctype* x, inc_t rs_x, inc_t cs_x, \ ctype* y, inc_t rs_y, inc_t cs_y \ BLIS_TAPI_EX_PARAMS \ ) \ { \ bli_init_once(); \ \ BLIS_TAPI_EX_DECLS \ \ const num_t dt = PASTEMAC(ch,type); \ \ ctype* x1; \ ctype* y1; \ conj_t conjx; \ dim_t n_elem; \ dim_t offx, offy; \ inc_t incx, incy; \ \ if ( bli_zero_dim2( m, n ) ) return; \ \ if ( bli_is_outside_diag( diagoffx, transx, m, n ) ) return; \ \ /* Determine the distance to the diagonals, the number of diagonal elements, and the diagonal increments. */ \ bli_set_dims_incs_2d \ ( \ diagoffx, transx, \ m, n, rs_x, cs_x, rs_y, cs_y, \ &offx, &offy, &n_elem, &incx, &incy \ ); \ \ conjx = bli_extract_conj( transx ); \ \ if ( bli_is_nonunit_diag( diagx ) ) \ { \ x1 = x + offx; \ y1 = y + offy; \ } \ else /* if ( bli_is_unit_diag( diagx ) ) */ \ { \ /* Simulate a unit diagonal for x with a zero increment over a unit scalar. */ \ x1 = PASTEMAC(ch,1); \ incx = 0; \ y1 = y + offy; \ } \ \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ PASTECH2(ch,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ conjx, \ n_elem, \ alpha, \ x1, incx, \ y1, incy, \ cntx \ ); \ } INSERT_GENTFUNC_BASIC2( axpyd, axpyv, BLIS_AXPYV_KER ) INSERT_GENTFUNC_BASIC2( scal2d, scal2v, BLIS_SCAL2V_KER ) #undef GENTFUNC #define GENTFUNC( ctype, ch, opname, kername, kerid ) \ \ void PASTEMAC2(ch,opname,EX_SUF) \ ( \ doff_t diagoffx, \ dim_t m, \ dim_t n, \ ctype* x, inc_t rs_x, inc_t cs_x \ BLIS_TAPI_EX_PARAMS \ ) \ { \ bli_init_once(); \ \ BLIS_TAPI_EX_DECLS \ \ const num_t dt = PASTEMAC(ch,type); \ \ ctype* x1; \ dim_t n_elem; \ dim_t offx; \ inc_t incx; \ \ if ( bli_zero_dim2( m, n ) ) return; \ \ if ( bli_is_outside_diag( diagoffx, BLIS_NO_TRANSPOSE, m, n ) ) return; \ \ /* Determine the distance to the diagonals, the number of diagonal elements, and the diagonal increments. */ \ bli_set_dims_incs_1d \ ( \ diagoffx, \ m, n, rs_x, cs_x, \ &offx, &n_elem, &incx \ ); \ \ x1 = x + offx; \ \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ PASTECH2(ch,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ n_elem, \ x1, incx, \ cntx \ ); \ } INSERT_GENTFUNC_BASIC2( invertd, invertv, BLIS_INVERTV_KER ) #undef GENTFUNC #define GENTFUNC( ctype, ch, opname, kername, kerid ) \ \ void PASTEMAC2(ch,opname,EX_SUF) \ ( \ conj_t conjalpha, \ doff_t diagoffx, \ dim_t m, \ dim_t n, \ ctype* alpha, \ ctype* x, inc_t rs_x, inc_t cs_x \ BLIS_TAPI_EX_PARAMS \ ) \ { \ bli_init_once(); \ \ BLIS_TAPI_EX_DECLS \ \ const num_t dt = PASTEMAC(ch,type); \ \ ctype* x1; \ dim_t n_elem; \ dim_t offx; \ inc_t incx; \ \ if ( bli_zero_dim2( m, n ) ) return; \ \ if ( bli_is_outside_diag( diagoffx, BLIS_NO_TRANSPOSE, m, n ) ) return; \ \ /* Determine the distance to the diagonals, the number of diagonal elements, and the diagonal increments. */ \ bli_set_dims_incs_1d \ ( \ diagoffx, \ m, n, rs_x, cs_x, \ &offx, &n_elem, &incx \ ); \ \ x1 = x + offx; \ \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ PASTECH2(ch,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ conjalpha, \ n_elem, \ alpha, \ x1, incx, \ cntx \ ); \ } INSERT_GENTFUNC_BASIC2( scald, scalv, BLIS_SCALV_KER ) INSERT_GENTFUNC_BASIC2( setd, setv, BLIS_SETV_KER ) #undef GENTFUNCR #define GENTFUNCR( ctype, ctype_r, ch, chr, opname, kername, kerid ) \ \ void PASTEMAC2(ch,opname,EX_SUF) \ ( \ doff_t diagoffx, \ dim_t m, \ dim_t n, \ ctype_r* alpha, \ ctype* x, inc_t rs_x, inc_t cs_x \ BLIS_TAPI_EX_PARAMS \ ) \ { \ bli_init_once(); \ \ BLIS_TAPI_EX_DECLS \ \ const num_t dt = PASTEMAC(ch,type); \ const num_t dt_r = PASTEMAC(chr,type); \ \ ctype_r* x1; \ dim_t n_elem; \ dim_t offx; \ inc_t incx; \ \ /* If the datatype is real, the entire operation is a no-op. */ \ if ( bli_is_real( dt ) ) return; \ \ if ( bli_zero_dim2( m, n ) ) return; \ \ if ( bli_is_outside_diag( diagoffx, BLIS_NO_TRANSPOSE, m, n ) ) return; \ \ /* Determine the distance to the diagonals, the number of diagonal elements, and the diagonal increments. */ \ bli_set_dims_incs_1d \ ( \ diagoffx, \ m, n, rs_x, cs_x, \ &offx, &n_elem, &incx \ ); \ \ /* Alternate implementation. (Substitute for remainder of function). */ \ /* for ( i = 0; i < n_elem; ++i ) \ { \ ctype* chi11 = x1 + (i )*incx; \ \ PASTEMAC(ch,setis)( *alpha, *chi11 ); \ } */ \ \ /* Acquire the addres of the imaginary component of the first element, and scale the increment for use in the real domain. Note that the indexing into the imaginary field only needs to work for complex datatypes since we return early for real domain types. */ \ x1 = ( ctype_r* )( x + offx ) + 1; \ incx = 2*incx; \ \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ PASTECH2(chr,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt_r, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ BLIS_NO_CONJUGATE, \ n_elem, \ alpha, \ x1, incx, \ cntx \ ); \ } INSERT_GENTFUNCR_BASIC2( setid, setv, BLIS_SETV_KER ) #endif
the_stack_data/87063.c
#include <assert.h> #include <netdb.h> #include <string.h> #include <arpa/inet.h> int main() { struct servent *ret = getservbyname("http", "tcp"); assert(ret); assert(!strcmp("http", ret->s_name)); assert(ret->s_port == htons(80)); assert(!strcmp("tcp", ret->s_proto)); ret = getservbyname("http", NULL); assert(ret); assert(!strcmp("http", ret->s_name)); assert(ret->s_port == htons(80)); assert(!strcmp("tcp", ret->s_proto)); ret = getservbyname("http", "udp"); assert(!ret); ret = getservbyname("", NULL); assert(!ret); return 0; }
the_stack_data/154828735.c
// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s // RUN: %clang_cc1 -fopenmp -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s // RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s // RUN: %clang_cc1 -fopenmp-simd -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp-simd -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s // expected-no-diagnostics #ifndef HEADER #define HEADER // CHECK: struct vec { struct vec { int len; double *data; }; // CHECK: }; // CHECK: struct dat { struct dat { int i; double d; #pragma omp declare mapper(id: struct vec v) map(v.len) // CHECK: #pragma omp declare mapper (id : struct vec v) map(tofrom: v.len){{$}} }; // CHECK: }; #pragma omp declare mapper(id: struct vec v) map(v.len) // CHECK: #pragma omp declare mapper (id : struct vec v) map(tofrom: v.len){{$}} #pragma omp declare mapper(default : struct vec kk) map(kk.len) map(kk.data[0:2]) // CHECK: #pragma omp declare mapper (default : struct vec kk) map(tofrom: kk.len) map(tofrom: kk.data[0:2]){{$}} #pragma omp declare mapper(struct dat d) map(to: d.d) // CHECK: #pragma omp declare mapper (default : struct dat d) map(to: d.d){{$}} // CHECK: int main() { int main() { #pragma omp declare mapper(id: struct vec v) map(v.len) // CHECK: #pragma omp declare mapper (id : struct vec v) map(tofrom: v.len) { #pragma omp declare mapper(id: struct vec v) map(v.len) // CHECK: #pragma omp declare mapper (id : struct vec v) map(tofrom: v.len) struct vec vv; struct dat dd[10]; #pragma omp target map(mapper(id) alloc: vv) // CHECK: #pragma omp target map(mapper(id),alloc: vv) { vv.len++; } #pragma omp target map(mapper(default), from: dd[0:10]) // CHECK: #pragma omp target map(mapper(default),from: dd[0:10]) { dd[0].i++; } #pragma omp target update to(mapper(id): vv) // CHECK: #pragma omp target update to(mapper(id): vv) } return 0; } // CHECK: } #endif
the_stack_data/119812.c
/*Exercise 2 - Selection Write a program to calculate the amount to be paid for a rented vehicle. • Input the distance the van has travelled • The first 30 km is at a rate of 50/= per km. • The remaining distance is calculated at the rate of 40/= per km. e.g. Distance -> 20 Amount = 20 x 50 = 1000 Distance -> 50 Amount = 30 x 50 + (50-30) x 40 = 2300*/ #include <stdio.h> int main() { float distance ; float rate ; printf("Enter distance van travelled : ") ; scanf("%f" , &distance) ; if( distance <= 30 ) { rate = distance * 50 ; } else if( distance > 30 ) { rate = 30 * 50 + ( distance - 30 ) * 40 ; } printf("total rate : %.2f" , rate) ; return 0; }
the_stack_data/7228.c
#include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <stdio.h> #include <string.h> #include <unistd.h> int main(int argc, char **argv) { struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; struct addrinfo *res; int rc = getaddrinfo(argv[1], argv[2], &hints, &res); if (rc != 0) printf("%s\n", gai_strerror(rc)); int fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); if (connect(fd, res->ai_addr, res->ai_addrlen) != 0) perror("connect"); char *msg = "test"; int len = strlen(msg) + 1; if (send(fd, msg, len, 0) == -1) perror("send"); if (close(fd) == -1) perror("close"); return 0; }
the_stack_data/3263738.c
#include <stdio.h> int main(void) { // A no. is said to be palindrome if the number when reversed equals to the same no. eg: 121* int n, reversedInteger = 0, remainder, originalInteger; printf("Enter an integer: "); scanf("%d", &n); originalInteger = n; // reversed integer is stored in variable while(n != 0) { remainder = n % 10; reversedInteger = reversedInteger * 10 + remainder; n /= 10; } // palindrome if orignalInteger and reversedInteger are equal if(originalInteger == reversedInteger) printf("%d is a palindrome.", originalInteger); else printf("%d is not a palindrome.", originalInteger); printf("\n"); return 0; }
the_stack_data/78469.c
#include<stdio.h> #include <stdlib.h> #include <time.h> typedef char TimeStr[24]; typedef char DayStr[5]; double CLOCKS_PER_MS = CLOCKS_PER_SEC / 1000.0; double nowms() { return (((double) clock()) / CLOCKS_PER_MS); //return ((double) clock() /); } double elap(const char *msg, double start, double stop) { double tmp = stop - start; printf ("%s elap = %9.2f\n", msg, tmp); } char * copyNext(char *dest, char *src, char delim) { while ((*src != 0) && (*src != delim)) { *dest = *src; dest++; src++; } *dest = 0; if (*src != 0) src++; return src; } double avg(double *nptr, int numCnt) { double total = 0.0; for (int ndx=0; ndx < numCnt; ndx++) { total += nptr[ndx]; } return total / numCnt; } int main() { double startRun = nowms(); FILE *ptr_file; char buf[1000]; char bbuf[50003]; ptr_file =fopen("2014.M1.csv","r"); if (!ptr_file) return 1; double startCount = nowms(); int bcnt = 0; int numRec = 0; while (1) { int numRead = fread(bbuf,1, 50000, ptr_file); if (numRead == 0) break; bbuf[numRead+1] = 0; char *ptr = (char *) &bbuf; for (; *ptr != 0; ptr++) { if (*ptr == '\n') numRec++; } bcnt++; } numRec--; // take one away for header. double stopCount = nowms(); int lca = numRec + 1; double startAlloc = nowms(); TimeStr *vtimes = (TimeStr *) malloc(sizeof(TimeStr) * lca); DayStr *vdays = (DayStr *) malloc(sizeof(DayStr) * lca); double *vopen = (double *) malloc(sizeof(double) * lca); double *vclose =(double *) malloc(sizeof(double) * lca); double *vhigh = (double *) malloc(sizeof(double) * lca); double *vlow = (double *) malloc(sizeof(double) * lca); int *vvolume = (int *) malloc(sizeof(int) * lca); double stopAlloc = nowms(); double startBuild = nowms(); fseek(ptr_file, 0, SEEK_SET); int lc = 0; char * tkn; char tkbuf[80]; fgets(buf,1000, ptr_file); // read first line while (fgets(buf,1000, ptr_file)!=NULL) { double tnum; tkn = (char *) &buf; tkn = copyNext(vtimes[lc], tkn, ','); // dateTime tkn = copyNext(vdays[lc], tkn, ','); // day tkn = copyNext(tkbuf, tkn, ','); // open vopen[lc] = atof((char *) &tkbuf); tkn = copyNext(tkbuf, tkn, ','); // close vclose[lc] = atof((char *) &tkbuf); tkn = copyNext(tkbuf, tkn, ','); // high vhigh[lc] = atof((char *) &tkbuf); tkn = copyNext(tkbuf, tkn, ','); // low vlow[lc] = atof((char *) &tkbuf); tkn = copyNext(tkbuf, tkn, ','); // volume vvolume[lc] = atol((char *) &tkbuf); lc++; } lc--; // one to high at end. double stopBuild = nowms(); double stopRun = stopBuild; double startAvg = nowms(); double tavg = avg(vclose, lc); double stopAvg = nowms(); double start100Avg = nowms(); for (int x=0; x<=100; x++) tavg = avg(vclose, lc); double stop100Avg = nowms(); double startCleanup = nowms(); free(vopen); free(vclose); free(vhigh); free(vlow); fclose(ptr_file); double stopCleanup = nowms(); elap("Read in 50K blocks", startCount, stopCount); printf("Read %d of 50k blocks\n", bcnt); printf("Read %d lines\n", numRec); elap("allocate vector array", startAlloc, stopAlloc); elap("build Recs", startBuild, stopBuild); printf("Read %d numRec\n", lc); elap("Total Load ", startRun, stopRun); elap("calc average", startAvg, stopAvg); double telap = stop100Avg - start100Avg; printf("calc average 100 times %11.2f each=%11.2f\n", telap, (telap / 100)); elap("cleanup", startCleanup, stopCleanup); return 0; }
the_stack_data/62638454.c
/* PROGRAM * wrchn_lex * * PURPOSE * write chain coded outlines on Lexidata * * SYNOPSIS * wrchn_lex(tr,lc,pixval) * * a chain coded file is expected from standard input. * * AUTHOR * Thao Le * for * Merickel Imaging Lab * Biomedical Engineering * University of Virginia * Charlottesville, Va. 22903 * * REVISIONS * 5/13/86 Allowed for standard input. * Stuart Ware Used Itec library routines. */ #include <stdio.h> #define X_MASK 0x0fc0 #define Y_MASK 0x03f wrchn_lex(tr,lc,pixval) short tr, lc; unsigned short pixval; { extern int CC_DIR[2][8]; int strnum,chnnum,quad,filflg,counter,drflg,cons; int x1,y1; short err, chan, count; short ot_buf[1024]; dsopn_(&err,&chan); count = 0; counter = 0; quad = 0; drflg = 1; while (drflg) { cons = fscanf(stdin,"%d %d %d %d\n",&strnum,&chnnum,&x1,&y1); /* Check to see if at the end of chain coded file */ if (cons == EOF) drflg = 0; /* not at end of file */ else { ot_buf[count++] = x1 + lc; ot_buf[count++] = y1 + tr; quad = 0; while (quad!=8) { counter++; if (counter>40) { counter = 1; fscanf (stdin, "\n"); } cons = fscanf (stdin,"%d ",&quad); if (cons==EOF) { printf ("*\n"); return(1); } if (quad == 8) { cons = fscanf (stdin,"\n"); dscvec_(&pixval,ot_buf,&count); count = 0; } else { ot_buf[count++] = 0x7000 | (X_MASK & (CC_DIR[0][quad] << 6)) | (Y_MASK & CC_DIR[1][quad]); if (count >= 1024) { fprintf(stderr,"wrchain_lex: too many points for internal buffer\n"); exit(2); } } }/*end while quad!=8*/ }/*end else*/ }/*end while drflg*/ dscls_(); return(0); }
the_stack_data/297835.c
#include <stdio.h> #include <string.h> void expand(char* s1, char* s2); int main() { char* s[] = {"a-z-", "z-a-", "-1-6-", "a-ee-a", "a-R-L", "1-9-1", "5-5", NULL}; char result[100]; int i = 0; while (s[i]) { // Expand and print the next string in our array s[] expand(result, s[i]); printf("Unexpanded:\t%s\n", s[i]); printf("Expanded:\t%s\n", result); i++; } return 0; } /** * Copies string s2 to s1, expanding ranges such * as 'a-z' and '8-3' */ void expand(char* s1, char* s2) { static char upper_alpha[27] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; static char lower_alpha[27] = "abcdefghijklmnopqrstuvwxyz"; static char digits[11] = "0123456789"; char *start, *end, *p; int i = 0, j = 0; // Loop through chars in s2 while (s2[i]) { switch (s2[i]) { case '-': if (i == 0 || s2[i+1] == '\0') { // '-' is leading or trailing, so copy it s1[j++] = '-'; i++; break; } else { // We've been given a range. Test whether the // two values are part of the same range. If so, // store pointers to the first and last chars in // the range in start/end, respectively. If not, // output an error message and skip this range. if ((start = strchr(upper_alpha, s2[i-1])) && (end = strchr(upper_alpha, s2[i+1]))) { // Do nothing } else if ((start = strchr(lower_alpha, s2[i-1])) && (end = strchr(lower_alpha, s2[i+1]))) { // Do nothing } else if ((start = strchr(digits, s2[i-1])) && (end = strchr(digits, s2[i+1]))) { // Do nothing } else { // We have mismatched operands in the range, // such as 'b-P' or '7-S', so error! and copy // the range expression fprintf(stderr, "Mismatched operands '%c-%c'\n", s2[i-1], s2[i+1]); s1[j++] = s2[i-1]; s1[j++] = s2[i++]; break; } // Expand the range p = start; while (p != end) { s1[j++] = *p; if (end > start) { p++; } else { p--; } } s1[j++] = *p; i += 2; } break; default: if (s2[i+1] == '-' && s2[i+2] != '\0') { // This is the first operand in a range, // so skip it, the range will be processed // in the next iteration of the loop. i++; } else { // Copy the normal char s1[j++] = s2[i++]; } break; } } s1[j] = s2[i]; // Make sure we finish off with a NULL char }
the_stack_data/243892593.c
// Full Ascending Stack implementation in C #include <stdio.h> #include <stdlib.h> #define MAX 10 int count = 0; // Creating a stack struct stack { int items[MAX]; int top; }; typedef struct stack st; void createEmptyStack(st *s) { s->top = -1; } // Check if the stack is full int isfull(st *s) { if (s->top == MAX - 1) return 1; else return 0; } // Check if the stack is empty int isempty(st *s) { if (s->top == -1) return 1; else return 0; } // Add elements into stack void push(st *s, int newitem) { if (isfull(s)) { printf("STACK FULL"); } else { s->top++; s->items[s->top] = newitem; } count++; } // Remove element from stack void pop(st *s) { if (isempty(s)) { printf("\n STACK EMPTY \n"); } else { printf("Item popped= %d", s->items[s->top]); s->top--; } count--; printf("\n"); } // Print elements of stack void printStack(st *s) { printf("Stack: "); for (int i = 0; i < count; i++) { printf("%d %p ", s->items[i], &(s->items[i])); } printf("\n"); } // Driver code int main() { int ch; st *s = (st *)malloc(sizeof(st)); createEmptyStack(s); push(s, 1); push(s, 2); push(s, 3); push(s, 4); printStack(s); pop(s); printf("\nAfter popping out\n"); printStack(s); }
the_stack_data/238077.c
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef unsigned char byte; typedef unsigned int u32; int main(int argc, char *argv[]) { FILE *fd, *fdoa, *fdob, *fdoc, *fdod; FILE *fdoe, *fdof, *fdog, *fdoh; byte *ibuf; char *infn; u32 va, vb, vc, vd; u32 ve, vf, vg, vh; int sz, n; int i, j, k; infn=NULL; for(i=1; i<argc; i++) { if(argv[i][0]=='-') { continue; } if(!infn) infn=argv[i]; } if(!infn) { printf("No Input File\n"); return(-1); } fd=fopen(infn, "rb"); if(!fd) { printf("Can't Open File %s\n", infn); return(-1); } fseek(fd, 0, 2); sz=ftell(fd); fseek(fd, 0, 0); ibuf=malloc(sz+32); fread(ibuf, 1, sz, fd); fclose(fd); #if 1 n=(sz+15)/16; fdoa=fopen("bootrom_1.txt", "wt"); for(i=0; i<n; i++) { va=*(u32 *)(ibuf+i*16+ 0); vb=*(u32 *)(ibuf+i*16+ 4); vc=*(u32 *)(ibuf+i*16+ 8); vd=*(u32 *)(ibuf+i*16+12); fprintf(fdoa, "%08X", vd); fprintf(fdoa, "%08X", vc); fprintf(fdoa, "%08X", vb); fprintf(fdoa, "%08X\n", va); } fclose(fdoa); // fclose(fdob); // fclose(fdoc); // fclose(fdod); #endif #if 1 n=(sz+15)/16; fdoa=fopen("bootrom_1a.txt", "wt"); fdob=fopen("bootrom_1b.txt", "wt"); fdoc=fopen("bootrom_1c.txt", "wt"); fdod=fopen("bootrom_1d.txt", "wt"); for(i=0; i<n; i++) { va=*(u32 *)(ibuf+i*16+ 0); vb=*(u32 *)(ibuf+i*16+ 4); vc=*(u32 *)(ibuf+i*16+ 8); vd=*(u32 *)(ibuf+i*16+12); fprintf(fdoa, "%08X\n", va); fprintf(fdob, "%08X\n", vb); fprintf(fdoc, "%08X\n", vc); fprintf(fdod, "%08X\n", vd); } fclose(fdoa); fclose(fdob); fclose(fdoc); fclose(fdod); #endif #if 0 n=(sz+31)/32; fdoa=fopen("bootrom_2a.txt", "wt"); fdob=fopen("bootrom_2b.txt", "wt"); fdoc=fopen("bootrom_2c.txt", "wt"); fdod=fopen("bootrom_2d.txt", "wt"); fdoe=fopen("bootrom_2e.txt", "wt"); fdof=fopen("bootrom_2f.txt", "wt"); fdog=fopen("bootrom_2g.txt", "wt"); fdoh=fopen("bootrom_2h.txt", "wt"); for(i=0; i<n; i++) { va=*(u32 *)(ibuf+i*32+ 0); vb=*(u32 *)(ibuf+i*32+ 4); vc=*(u32 *)(ibuf+i*32+ 8); vd=*(u32 *)(ibuf+i*32+12); ve=*(u32 *)(ibuf+i*32+16); vf=*(u32 *)(ibuf+i*32+20); vg=*(u32 *)(ibuf+i*32+24); vh=*(u32 *)(ibuf+i*32+28); fprintf(fdoa, "%08X\n", va); fprintf(fdob, "%08X\n", vb); fprintf(fdoc, "%08X\n", vc); fprintf(fdod, "%08X\n", vd); fprintf(fdoe, "%08X\n", ve); fprintf(fdof, "%08X\n", vf); fprintf(fdog, "%08X\n", vg); fprintf(fdoh, "%08X\n", vh); } fclose(fdoa); fclose(fdob); fclose(fdoc); fclose(fdod); fclose(fdoe); fclose(fdof); fclose(fdog); fclose(fdoh); #endif return(0); }
the_stack_data/750268.c
/*numPass=6, numTotal=6 Verdict:ACCEPTED, Visibility:1, Input:"4 1 100 99 100 2 100 98 98 3 1 1 1 4 91 12 12", ExpOutput:"1 2 4 3 ", Output:"1 2 4 3 " Verdict:ACCEPTED, Visibility:1, Input:"3 13745 30 59 50 12845 31 23 50 12424 31 23 40 ", ExpOutput:"12845 13745 12424 ", Output:"12845 13745 12424 " Verdict:ACCEPTED, Visibility:1, Input:"4 1 50 20 30 4 30 40 10 2 40 40 10 3 35 29 40", ExpOutput:"3 1 2 4 ", Output:"3 1 2 4 " Verdict:ACCEPTED, Visibility:0, Input:"2 1 50 50 50 2 50 30 50", ExpOutput:"1 2 ", Output:"1 2 " Verdict:ACCEPTED, Visibility:0, Input:"4 1 50 50 50 2 50 30 50 3 20 50 56 4 58 29 50", ExpOutput:"3 4 1 2 ", Output:"3 4 1 2 " Verdict:ACCEPTED, Visibility:0, Input:"5 1 50 50 30 2 20 30 50 3 80 50 66 4 10 29 10 5 10 10 10", ExpOutput:"3 2 1 4 5 ", Output:"3 2 1 4 5 " */ #include <stdio.h> #include <stdlib.h> typedef struct student Std; struct student{ int roll,phy,chm,mth;}; Std *ar; void rearrange(int n) { int i,j; int t1,t2,t3,t4; for(j=0;j<n;j++) { for(i=0;i<n-1;i++) { if(ar[i+1].mth > ar[i].mth) { t1=ar[i+1].roll; ar[i+1].roll=ar[i].roll; ar[i].roll=t1; t2=ar[i+1].phy; ar[i+1].phy=ar[i].phy; ar[i].phy=t2; t3=ar[i+1].chm; ar[i+1].chm=ar[i].chm; ar[i].chm=t3; t4=ar[i+1].mth; ar[i+1].mth=ar[i].mth; ar[i].mth=t4; } else if(ar[i+1].mth ==ar[i].mth) { if(ar[i+1].phy>ar[i].phy) { t1=ar[i+1].roll; ar[i+1].roll=ar[i].roll; ar[i].roll=t1; t2=ar[i+1].phy; ar[i+1].phy=ar[i].phy; ar[i].phy=t2; t3=ar[i+1].chm; ar[i+1].chm=ar[i].chm; ar[i].chm=t3; t4=ar[i+1].mth; ar[i+1].mth=ar[i].mth; ar[i].mth=t4; } else if(ar[i+1].phy==ar[i].phy) { if(ar[i+1].chm>ar[i].chm) { t1=ar[i+1].roll; ar[i+1].roll=ar[i].roll; ar[i].roll=t1; t2=ar[i+1].phy; ar[i+1].phy=ar[i].phy; ar[i].phy=t2; t3=ar[i+1].chm; ar[i+1].chm=ar[i].chm; ar[i].chm=t3; t4=ar[i+1].mth; ar[i+1].mth=ar[i].mth; ar[i].mth=t4; } } } } } } int main() { int n; scanf("%d",&n); ar = (Std*)malloc(n*sizeof(Std)); for(int i=0;i<n;i++) { scanf("%d %d %d %d",&ar[i].roll,&ar[i].phy,&ar[i].chm,&ar[i].mth); } rearrange(n); for(int i=0;i<n;i++) { printf("%d\n",ar[i].roll); } free (ar); return 0; }
the_stack_data/43888955.c
#include <stdio.h> #include <stdbool.h> bool isPrime(int); int main(int argc, char const *argv[]) { int num1,num2; printf("Enter tow numbers:"); scanf("%d%d",&num1,&num2); for (int i = num1+1; i < num2; ++i) { if (isPrime(i)) printf("%d ",i); } return 0; } bool isPrime(int num){ bool is_prime=true; for (int i = 2; i < num; ++i) { if(num%i==0) is_prime=false; } return is_prime; }
the_stack_data/492190.c
#include<stdio.h> int main() { int i,j,n; printf("enter row size:"); scanf("%d",&n); for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { printf("10"); } printf("\n"); } return 0; }
the_stack_data/12378.c
/* * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <openssl/e_os2.h> #include <string.h> #include <assert.h> #ifndef KECCAK1600_ASM #define ROL32(a, offset) (((a) << (offset)) | ((a) >> ((32 - (offset)) & 31))) static uint64_t ROL64(uint64_t val, int offset) { if (offset == 0) { return val; } else if (sizeof(void *) == 8) { return (val << offset) | (val >> (64-offset)); } else { uint32_t hi = (uint32_t)(val >> 32), lo = (uint32_t)val; if (offset & 1) { uint32_t tmp = hi; offset >>= 1; hi = ROL32(lo, offset); lo = ROL32(tmp, offset + 1); } else { offset >>= 1; lo = ROL32(lo, offset); hi = ROL32(hi, offset); } return ((uint64_t)hi << 32) | lo; } } static const unsigned char rhotates[5][5] = { { 0, 1, 62, 28, 27 }, { 36, 44, 6, 55, 20 }, { 3, 10, 43, 25, 39 }, { 41, 45, 15, 21, 8 }, { 18, 2, 61, 56, 14 } }; static const uint64_t iotas[] = { sizeof(void *) == 8 ? 0x0000000000000001U : 0x0000000000000001U, sizeof(void *) == 8 ? 0x0000000000008082U : 0x0000008900000000U, sizeof(void *) == 8 ? 0x800000000000808aU : 0x8000008b00000000U, sizeof(void *) == 8 ? 0x8000000080008000U : 0x8000808000000000U, sizeof(void *) == 8 ? 0x000000000000808bU : 0x0000008b00000001U, sizeof(void *) == 8 ? 0x0000000080000001U : 0x0000800000000001U, sizeof(void *) == 8 ? 0x8000000080008081U : 0x8000808800000001U, sizeof(void *) == 8 ? 0x8000000000008009U : 0x8000008200000001U, sizeof(void *) == 8 ? 0x000000000000008aU : 0x0000000b00000000U, sizeof(void *) == 8 ? 0x0000000000000088U : 0x0000000a00000000U, sizeof(void *) == 8 ? 0x0000000080008009U : 0x0000808200000001U, sizeof(void *) == 8 ? 0x000000008000000aU : 0x0000800300000000U, sizeof(void *) == 8 ? 0x000000008000808bU : 0x0000808b00000001U, sizeof(void *) == 8 ? 0x800000000000008bU : 0x8000000b00000001U, sizeof(void *) == 8 ? 0x8000000000008089U : 0x8000008a00000001U, sizeof(void *) == 8 ? 0x8000000000008003U : 0x8000008100000001U, sizeof(void *) == 8 ? 0x8000000000008002U : 0x8000008100000000U, sizeof(void *) == 8 ? 0x8000000000000080U : 0x8000000800000000U, sizeof(void *) == 8 ? 0x000000000000800aU : 0x0000008300000000U, sizeof(void *) == 8 ? 0x800000008000000aU : 0x8000800300000000U, sizeof(void *) == 8 ? 0x8000000080008081U : 0x8000808800000001U, sizeof(void *) == 8 ? 0x8000000000008080U : 0x8000008800000000U, sizeof(void *) == 8 ? 0x0000000080000001U : 0x0000800000000001U, sizeof(void *) == 8 ? 0x8000000080008008U : 0x8000808200000000U }; #if defined(KECCAK_REF) /* * This is straightforward or "maximum clarity" implementation aiming * to resemble section 3.2 of the FIPS PUB 202 "SHA-3 Standard: * Permutation-Based Hash and Extendible-Output Functions" as much as * possible. With one caveat. Because of the way C stores matrices, * references to A[x,y] in the specification are presented as A[y][x]. * Implementation unrolls inner x-loops so that modulo 5 operations are * explicitly pre-computed. */ static void Theta(uint64_t A[5][5]) { uint64_t C[5], D[5]; size_t y; C[0] = A[0][0]; C[1] = A[0][1]; C[2] = A[0][2]; C[3] = A[0][3]; C[4] = A[0][4]; for (y = 1; y < 5; y++) { C[0] ^= A[y][0]; C[1] ^= A[y][1]; C[2] ^= A[y][2]; C[3] ^= A[y][3]; C[4] ^= A[y][4]; } D[0] = ROL64(C[1], 1) ^ C[4]; D[1] = ROL64(C[2], 1) ^ C[0]; D[2] = ROL64(C[3], 1) ^ C[1]; D[3] = ROL64(C[4], 1) ^ C[2]; D[4] = ROL64(C[0], 1) ^ C[3]; for (y = 0; y < 5; y++) { A[y][0] ^= D[0]; A[y][1] ^= D[1]; A[y][2] ^= D[2]; A[y][3] ^= D[3]; A[y][4] ^= D[4]; } } static void Rho(uint64_t A[5][5]) { size_t y; for (y = 0; y < 5; y++) { A[y][0] = ROL64(A[y][0], rhotates[y][0]); A[y][1] = ROL64(A[y][1], rhotates[y][1]); A[y][2] = ROL64(A[y][2], rhotates[y][2]); A[y][3] = ROL64(A[y][3], rhotates[y][3]); A[y][4] = ROL64(A[y][4], rhotates[y][4]); } } static void Pi(uint64_t A[5][5]) { uint64_t T[5][5]; /* * T = A * A[y][x] = T[x][(3*y+x)%5] */ memcpy(T, A, sizeof(T)); A[0][0] = T[0][0]; A[0][1] = T[1][1]; A[0][2] = T[2][2]; A[0][3] = T[3][3]; A[0][4] = T[4][4]; A[1][0] = T[0][3]; A[1][1] = T[1][4]; A[1][2] = T[2][0]; A[1][3] = T[3][1]; A[1][4] = T[4][2]; A[2][0] = T[0][1]; A[2][1] = T[1][2]; A[2][2] = T[2][3]; A[2][3] = T[3][4]; A[2][4] = T[4][0]; A[3][0] = T[0][4]; A[3][1] = T[1][0]; A[3][2] = T[2][1]; A[3][3] = T[3][2]; A[3][4] = T[4][3]; A[4][0] = T[0][2]; A[4][1] = T[1][3]; A[4][2] = T[2][4]; A[4][3] = T[3][0]; A[4][4] = T[4][1]; } static void Chi(uint64_t A[5][5]) { uint64_t C[5]; size_t y; for (y = 0; y < 5; y++) { C[0] = A[y][0] ^ (~A[y][1] & A[y][2]); C[1] = A[y][1] ^ (~A[y][2] & A[y][3]); C[2] = A[y][2] ^ (~A[y][3] & A[y][4]); C[3] = A[y][3] ^ (~A[y][4] & A[y][0]); C[4] = A[y][4] ^ (~A[y][0] & A[y][1]); A[y][0] = C[0]; A[y][1] = C[1]; A[y][2] = C[2]; A[y][3] = C[3]; A[y][4] = C[4]; } } static void Iota(uint64_t A[5][5], size_t i) { assert(i < (sizeof(iotas) / sizeof(iotas[0]))); A[0][0] ^= iotas[i]; } void KeccakF1600(uint64_t A[5][5]) { size_t i; for (i = 0; i < 24; i++) { Theta(A); Rho(A); Pi(A); Chi(A); Iota(A, i); } } #elif defined(KECCAK_1X) /* * This implementation is optimization of above code featuring unroll * of even y-loops, their fusion and code motion. It also minimizes * temporary storage. Compiler would normally do all these things for * you, purpose of manual optimization is to provide "unobscured" * reference for assembly implementation [in case this approach is * chosen for implementation on some platform]. In the nutshell it's * equivalent of "plane-per-plane processing" approach discussed in * section 2.4 of "Keccak implementation overview". */ static void Round(uint64_t A[5][5], size_t i) { uint64_t C[5], E[2]; /* registers */ uint64_t D[5], T[2][5]; /* memory */ assert(i < (sizeof(iotas) / sizeof(iotas[0]))); C[0] = A[0][0] ^ A[1][0] ^ A[2][0] ^ A[3][0] ^ A[4][0]; C[1] = A[0][1] ^ A[1][1] ^ A[2][1] ^ A[3][1] ^ A[4][1]; C[2] = A[0][2] ^ A[1][2] ^ A[2][2] ^ A[3][2] ^ A[4][2]; C[3] = A[0][3] ^ A[1][3] ^ A[2][3] ^ A[3][3] ^ A[4][3]; C[4] = A[0][4] ^ A[1][4] ^ A[2][4] ^ A[3][4] ^ A[4][4]; #if defined(__arm__) D[1] = E[0] = ROL64(C[2], 1) ^ C[0]; D[4] = E[1] = ROL64(C[0], 1) ^ C[3]; D[0] = C[0] = ROL64(C[1], 1) ^ C[4]; D[2] = C[1] = ROL64(C[3], 1) ^ C[1]; D[3] = C[2] = ROL64(C[4], 1) ^ C[2]; T[0][0] = A[3][0] ^ C[0]; /* borrow T[0][0] */ T[0][1] = A[0][1] ^ E[0]; /* D[1] */ T[0][2] = A[0][2] ^ C[1]; /* D[2] */ T[0][3] = A[0][3] ^ C[2]; /* D[3] */ T[0][4] = A[0][4] ^ E[1]; /* D[4] */ C[3] = ROL64(A[3][3] ^ C[2], rhotates[3][3]); /* D[3] */ C[4] = ROL64(A[4][4] ^ E[1], rhotates[4][4]); /* D[4] */ C[0] = A[0][0] ^ C[0]; /* rotate by 0 */ /* D[0] */ C[2] = ROL64(A[2][2] ^ C[1], rhotates[2][2]); /* D[2] */ C[1] = ROL64(A[1][1] ^ E[0], rhotates[1][1]); /* D[1] */ #else D[0] = ROL64(C[1], 1) ^ C[4]; D[1] = ROL64(C[2], 1) ^ C[0]; D[2] = ROL64(C[3], 1) ^ C[1]; D[3] = ROL64(C[4], 1) ^ C[2]; D[4] = ROL64(C[0], 1) ^ C[3]; T[0][0] = A[3][0] ^ D[0]; /* borrow T[0][0] */ T[0][1] = A[0][1] ^ D[1]; T[0][2] = A[0][2] ^ D[2]; T[0][3] = A[0][3] ^ D[3]; T[0][4] = A[0][4] ^ D[4]; C[0] = A[0][0] ^ D[0]; /* rotate by 0 */ C[1] = ROL64(A[1][1] ^ D[1], rhotates[1][1]); C[2] = ROL64(A[2][2] ^ D[2], rhotates[2][2]); C[3] = ROL64(A[3][3] ^ D[3], rhotates[3][3]); C[4] = ROL64(A[4][4] ^ D[4], rhotates[4][4]); #endif A[0][0] = C[0] ^ (~C[1] & C[2]) ^ iotas[i]; A[0][1] = C[1] ^ (~C[2] & C[3]); A[0][2] = C[2] ^ (~C[3] & C[4]); A[0][3] = C[3] ^ (~C[4] & C[0]); A[0][4] = C[4] ^ (~C[0] & C[1]); T[1][0] = A[1][0] ^ (C[3] = D[0]); T[1][1] = A[2][1] ^ (C[4] = D[1]); /* borrow T[1][1] */ T[1][2] = A[1][2] ^ (E[0] = D[2]); T[1][3] = A[1][3] ^ (E[1] = D[3]); T[1][4] = A[2][4] ^ (C[2] = D[4]); /* borrow T[1][4] */ C[0] = ROL64(T[0][3], rhotates[0][3]); C[1] = ROL64(A[1][4] ^ C[2], rhotates[1][4]); /* D[4] */ C[2] = ROL64(A[2][0] ^ C[3], rhotates[2][0]); /* D[0] */ C[3] = ROL64(A[3][1] ^ C[4], rhotates[3][1]); /* D[1] */ C[4] = ROL64(A[4][2] ^ E[0], rhotates[4][2]); /* D[2] */ A[1][0] = C[0] ^ (~C[1] & C[2]); A[1][1] = C[1] ^ (~C[2] & C[3]); A[1][2] = C[2] ^ (~C[3] & C[4]); A[1][3] = C[3] ^ (~C[4] & C[0]); A[1][4] = C[4] ^ (~C[0] & C[1]); C[0] = ROL64(T[0][1], rhotates[0][1]); C[1] = ROL64(T[1][2], rhotates[1][2]); C[2] = ROL64(A[2][3] ^ D[3], rhotates[2][3]); C[3] = ROL64(A[3][4] ^ D[4], rhotates[3][4]); C[4] = ROL64(A[4][0] ^ D[0], rhotates[4][0]); A[2][0] = C[0] ^ (~C[1] & C[2]); A[2][1] = C[1] ^ (~C[2] & C[3]); A[2][2] = C[2] ^ (~C[3] & C[4]); A[2][3] = C[3] ^ (~C[4] & C[0]); A[2][4] = C[4] ^ (~C[0] & C[1]); C[0] = ROL64(T[0][4], rhotates[0][4]); C[1] = ROL64(T[1][0], rhotates[1][0]); C[2] = ROL64(T[1][1], rhotates[2][1]); /* originally A[2][1] */ C[3] = ROL64(A[3][2] ^ D[2], rhotates[3][2]); C[4] = ROL64(A[4][3] ^ D[3], rhotates[4][3]); A[3][0] = C[0] ^ (~C[1] & C[2]); A[3][1] = C[1] ^ (~C[2] & C[3]); A[3][2] = C[2] ^ (~C[3] & C[4]); A[3][3] = C[3] ^ (~C[4] & C[0]); A[3][4] = C[4] ^ (~C[0] & C[1]); C[0] = ROL64(T[0][2], rhotates[0][2]); C[1] = ROL64(T[1][3], rhotates[1][3]); C[2] = ROL64(T[1][4], rhotates[2][4]); /* originally A[2][4] */ C[3] = ROL64(T[0][0], rhotates[3][0]); /* originally A[3][0] */ C[4] = ROL64(A[4][1] ^ D[1], rhotates[4][1]); A[4][0] = C[0] ^ (~C[1] & C[2]); A[4][1] = C[1] ^ (~C[2] & C[3]); A[4][2] = C[2] ^ (~C[3] & C[4]); A[4][3] = C[3] ^ (~C[4] & C[0]); A[4][4] = C[4] ^ (~C[0] & C[1]); } void KeccakF1600(uint64_t A[5][5]) { size_t i; for (i = 0; i < 24; i++) { Round(A, i); } } #elif defined(KECCAK_1X_ALT) /* * This is variant of above KECCAK_1X that reduces requirement for * temporary storage even further, but at cost of more updates to A[][]. * It's less suitable if A[][] is memory bound, but better if it's * register bound. */ static void Round(uint64_t A[5][5], size_t i) { uint64_t C[5], D[5]; assert(i < (sizeof(iotas) / sizeof(iotas[0]))); C[0] = A[0][0] ^ A[1][0] ^ A[2][0] ^ A[3][0] ^ A[4][0]; C[1] = A[0][1] ^ A[1][1] ^ A[2][1] ^ A[3][1] ^ A[4][1]; C[2] = A[0][2] ^ A[1][2] ^ A[2][2] ^ A[3][2] ^ A[4][2]; C[3] = A[0][3] ^ A[1][3] ^ A[2][3] ^ A[3][3] ^ A[4][3]; C[4] = A[0][4] ^ A[1][4] ^ A[2][4] ^ A[3][4] ^ A[4][4]; D[1] = C[0] ^ ROL64(C[2], 1); D[2] = C[1] ^ ROL64(C[3], 1); D[3] = C[2] ^= ROL64(C[4], 1); D[4] = C[3] ^= ROL64(C[0], 1); D[0] = C[4] ^= ROL64(C[1], 1); A[0][1] ^= D[1]; A[1][1] ^= D[1]; A[2][1] ^= D[1]; A[3][1] ^= D[1]; A[4][1] ^= D[1]; A[0][2] ^= D[2]; A[1][2] ^= D[2]; A[2][2] ^= D[2]; A[3][2] ^= D[2]; A[4][2] ^= D[2]; A[0][3] ^= C[2]; A[1][3] ^= C[2]; A[2][3] ^= C[2]; A[3][3] ^= C[2]; A[4][3] ^= C[2]; A[0][4] ^= C[3]; A[1][4] ^= C[3]; A[2][4] ^= C[3]; A[3][4] ^= C[3]; A[4][4] ^= C[3]; A[0][0] ^= C[4]; A[1][0] ^= C[4]; A[2][0] ^= C[4]; A[3][0] ^= C[4]; A[4][0] ^= C[4]; C[1] = A[0][1]; C[2] = A[0][2]; C[3] = A[0][3]; C[4] = A[0][4]; A[0][1] = ROL64(A[1][1], rhotates[1][1]); A[0][2] = ROL64(A[2][2], rhotates[2][2]); A[0][3] = ROL64(A[3][3], rhotates[3][3]); A[0][4] = ROL64(A[4][4], rhotates[4][4]); A[1][1] = ROL64(A[1][4], rhotates[1][4]); A[2][2] = ROL64(A[2][3], rhotates[2][3]); A[3][3] = ROL64(A[3][2], rhotates[3][2]); A[4][4] = ROL64(A[4][1], rhotates[4][1]); A[1][4] = ROL64(A[4][2], rhotates[4][2]); A[2][3] = ROL64(A[3][4], rhotates[3][4]); A[3][2] = ROL64(A[2][1], rhotates[2][1]); A[4][1] = ROL64(A[1][3], rhotates[1][3]); A[4][2] = ROL64(A[2][4], rhotates[2][4]); A[3][4] = ROL64(A[4][3], rhotates[4][3]); A[2][1] = ROL64(A[1][2], rhotates[1][2]); A[1][3] = ROL64(A[3][1], rhotates[3][1]); A[2][4] = ROL64(A[4][0], rhotates[4][0]); A[4][3] = ROL64(A[3][0], rhotates[3][0]); A[1][2] = ROL64(A[2][0], rhotates[2][0]); A[3][1] = ROL64(A[1][0], rhotates[1][0]); A[1][0] = ROL64(C[3], rhotates[0][3]); A[2][0] = ROL64(C[1], rhotates[0][1]); A[3][0] = ROL64(C[4], rhotates[0][4]); A[4][0] = ROL64(C[2], rhotates[0][2]); C[0] = A[0][0]; C[1] = A[1][0]; D[0] = A[0][1]; D[1] = A[1][1]; A[0][0] ^= (~A[0][1] & A[0][2]); A[1][0] ^= (~A[1][1] & A[1][2]); A[0][1] ^= (~A[0][2] & A[0][3]); A[1][1] ^= (~A[1][2] & A[1][3]); A[0][2] ^= (~A[0][3] & A[0][4]); A[1][2] ^= (~A[1][3] & A[1][4]); A[0][3] ^= (~A[0][4] & C[0]); A[1][3] ^= (~A[1][4] & C[1]); A[0][4] ^= (~C[0] & D[0]); A[1][4] ^= (~C[1] & D[1]); C[2] = A[2][0]; C[3] = A[3][0]; D[2] = A[2][1]; D[3] = A[3][1]; A[2][0] ^= (~A[2][1] & A[2][2]); A[3][0] ^= (~A[3][1] & A[3][2]); A[2][1] ^= (~A[2][2] & A[2][3]); A[3][1] ^= (~A[3][2] & A[3][3]); A[2][2] ^= (~A[2][3] & A[2][4]); A[3][2] ^= (~A[3][3] & A[3][4]); A[2][3] ^= (~A[2][4] & C[2]); A[3][3] ^= (~A[3][4] & C[3]); A[2][4] ^= (~C[2] & D[2]); A[3][4] ^= (~C[3] & D[3]); C[4] = A[4][0]; D[4] = A[4][1]; A[4][0] ^= (~A[4][1] & A[4][2]); A[4][1] ^= (~A[4][2] & A[4][3]); A[4][2] ^= (~A[4][3] & A[4][4]); A[4][3] ^= (~A[4][4] & C[4]); A[4][4] ^= (~C[4] & D[4]); A[0][0] ^= iotas[i]; } void KeccakF1600(uint64_t A[5][5]) { size_t i; for (i = 0; i < 24; i++) { Round(A, i); } } #elif defined(KECCAK_2X) /* * This implementation is variant of KECCAK_1X above with outer-most * round loop unrolled twice. This allows to take temporary storage * out of round procedure and simplify references to it by alternating * it with actual data (see round loop below). Just like original, it's * rather meant as reference for an assembly implementation. It's likely * to provide best instruction per processed byte ratio at minimal * round unroll factor... */ static void Round(uint64_t R[5][5], uint64_t A[5][5], size_t i) { uint64_t C[5], D[5]; assert(i < (sizeof(iotas) / sizeof(iotas[0]))); C[0] = A[0][0] ^ A[1][0] ^ A[2][0] ^ A[3][0] ^ A[4][0]; C[1] = A[0][1] ^ A[1][1] ^ A[2][1] ^ A[3][1] ^ A[4][1]; C[2] = A[0][2] ^ A[1][2] ^ A[2][2] ^ A[3][2] ^ A[4][2]; C[3] = A[0][3] ^ A[1][3] ^ A[2][3] ^ A[3][3] ^ A[4][3]; C[4] = A[0][4] ^ A[1][4] ^ A[2][4] ^ A[3][4] ^ A[4][4]; D[0] = ROL64(C[1], 1) ^ C[4]; D[1] = ROL64(C[2], 1) ^ C[0]; D[2] = ROL64(C[3], 1) ^ C[1]; D[3] = ROL64(C[4], 1) ^ C[2]; D[4] = ROL64(C[0], 1) ^ C[3]; C[0] = A[0][0] ^ D[0]; /* rotate by 0 */ C[1] = ROL64(A[1][1] ^ D[1], rhotates[1][1]); C[2] = ROL64(A[2][2] ^ D[2], rhotates[2][2]); C[3] = ROL64(A[3][3] ^ D[3], rhotates[3][3]); C[4] = ROL64(A[4][4] ^ D[4], rhotates[4][4]); #ifdef KECCAK_COMPLEMENTING_TRANSFORM R[0][0] = C[0] ^ ( C[1] | C[2]) ^ iotas[i]; R[0][1] = C[1] ^ (~C[2] | C[3]); R[0][2] = C[2] ^ ( C[3] & C[4]); R[0][3] = C[3] ^ ( C[4] | C[0]); R[0][4] = C[4] ^ ( C[0] & C[1]); #else R[0][0] = C[0] ^ (~C[1] & C[2]) ^ iotas[i]; R[0][1] = C[1] ^ (~C[2] & C[3]); R[0][2] = C[2] ^ (~C[3] & C[4]); R[0][3] = C[3] ^ (~C[4] & C[0]); R[0][4] = C[4] ^ (~C[0] & C[1]); #endif C[0] = ROL64(A[0][3] ^ D[3], rhotates[0][3]); C[1] = ROL64(A[1][4] ^ D[4], rhotates[1][4]); C[2] = ROL64(A[2][0] ^ D[0], rhotates[2][0]); C[3] = ROL64(A[3][1] ^ D[1], rhotates[3][1]); C[4] = ROL64(A[4][2] ^ D[2], rhotates[4][2]); #ifdef KECCAK_COMPLEMENTING_TRANSFORM R[1][0] = C[0] ^ (C[1] | C[2]); R[1][1] = C[1] ^ (C[2] & C[3]); R[1][2] = C[2] ^ (C[3] | ~C[4]); R[1][3] = C[3] ^ (C[4] | C[0]); R[1][4] = C[4] ^ (C[0] & C[1]); #else R[1][0] = C[0] ^ (~C[1] & C[2]); R[1][1] = C[1] ^ (~C[2] & C[3]); R[1][2] = C[2] ^ (~C[3] & C[4]); R[1][3] = C[3] ^ (~C[4] & C[0]); R[1][4] = C[4] ^ (~C[0] & C[1]); #endif C[0] = ROL64(A[0][1] ^ D[1], rhotates[0][1]); C[1] = ROL64(A[1][2] ^ D[2], rhotates[1][2]); C[2] = ROL64(A[2][3] ^ D[3], rhotates[2][3]); C[3] = ROL64(A[3][4] ^ D[4], rhotates[3][4]); C[4] = ROL64(A[4][0] ^ D[0], rhotates[4][0]); #ifdef KECCAK_COMPLEMENTING_TRANSFORM R[2][0] = C[0] ^ ( C[1] | C[2]); R[2][1] = C[1] ^ ( C[2] & C[3]); R[2][2] = C[2] ^ (~C[3] & C[4]); R[2][3] = ~C[3] ^ ( C[4] | C[0]); R[2][4] = C[4] ^ ( C[0] & C[1]); #else R[2][0] = C[0] ^ (~C[1] & C[2]); R[2][1] = C[1] ^ (~C[2] & C[3]); R[2][2] = C[2] ^ (~C[3] & C[4]); R[2][3] = C[3] ^ (~C[4] & C[0]); R[2][4] = C[4] ^ (~C[0] & C[1]); #endif C[0] = ROL64(A[0][4] ^ D[4], rhotates[0][4]); C[1] = ROL64(A[1][0] ^ D[0], rhotates[1][0]); C[2] = ROL64(A[2][1] ^ D[1], rhotates[2][1]); C[3] = ROL64(A[3][2] ^ D[2], rhotates[3][2]); C[4] = ROL64(A[4][3] ^ D[3], rhotates[4][3]); #ifdef KECCAK_COMPLEMENTING_TRANSFORM R[3][0] = C[0] ^ ( C[1] & C[2]); R[3][1] = C[1] ^ ( C[2] | C[3]); R[3][2] = C[2] ^ (~C[3] | C[4]); R[3][3] = ~C[3] ^ ( C[4] & C[0]); R[3][4] = C[4] ^ ( C[0] | C[1]); #else R[3][0] = C[0] ^ (~C[1] & C[2]); R[3][1] = C[1] ^ (~C[2] & C[3]); R[3][2] = C[2] ^ (~C[3] & C[4]); R[3][3] = C[3] ^ (~C[4] & C[0]); R[3][4] = C[4] ^ (~C[0] & C[1]); #endif C[0] = ROL64(A[0][2] ^ D[2], rhotates[0][2]); C[1] = ROL64(A[1][3] ^ D[3], rhotates[1][3]); C[2] = ROL64(A[2][4] ^ D[4], rhotates[2][4]); C[3] = ROL64(A[3][0] ^ D[0], rhotates[3][0]); C[4] = ROL64(A[4][1] ^ D[1], rhotates[4][1]); #ifdef KECCAK_COMPLEMENTING_TRANSFORM R[4][0] = C[0] ^ (~C[1] & C[2]); R[4][1] = ~C[1] ^ ( C[2] | C[3]); R[4][2] = C[2] ^ ( C[3] & C[4]); R[4][3] = C[3] ^ ( C[4] | C[0]); R[4][4] = C[4] ^ ( C[0] & C[1]); #else R[4][0] = C[0] ^ (~C[1] & C[2]); R[4][1] = C[1] ^ (~C[2] & C[3]); R[4][2] = C[2] ^ (~C[3] & C[4]); R[4][3] = C[3] ^ (~C[4] & C[0]); R[4][4] = C[4] ^ (~C[0] & C[1]); #endif } void KeccakF1600(uint64_t A[5][5]) { uint64_t T[5][5]; size_t i; #ifdef KECCAK_COMPLEMENTING_TRANSFORM A[0][1] = ~A[0][1]; A[0][2] = ~A[0][2]; A[1][3] = ~A[1][3]; A[2][2] = ~A[2][2]; A[3][2] = ~A[3][2]; A[4][0] = ~A[4][0]; #endif for (i = 0; i < 24; i += 2) { Round(T, A, i); Round(A, T, i + 1); } #ifdef KECCAK_COMPLEMENTING_TRANSFORM A[0][1] = ~A[0][1]; A[0][2] = ~A[0][2]; A[1][3] = ~A[1][3]; A[2][2] = ~A[2][2]; A[3][2] = ~A[3][2]; A[4][0] = ~A[4][0]; #endif } #else /* * This implementation is KECCAK_1X from above combined 4 times with * a twist that allows to omit temporary storage and perform in-place * processing. It's discussed in section 2.5 of "Keccak implementation * overview". It's likely to be best suited for processors with large * register bank... */ static void FourRounds(uint64_t A[5][5], size_t i) { uint64_t B[5], C[5], D[5]; assert(i <= (sizeof(iotas) / sizeof(iotas[0]) - 4)); /* Round 4*n */ C[0] = A[0][0] ^ A[1][0] ^ A[2][0] ^ A[3][0] ^ A[4][0]; C[1] = A[0][1] ^ A[1][1] ^ A[2][1] ^ A[3][1] ^ A[4][1]; C[2] = A[0][2] ^ A[1][2] ^ A[2][2] ^ A[3][2] ^ A[4][2]; C[3] = A[0][3] ^ A[1][3] ^ A[2][3] ^ A[3][3] ^ A[4][3]; C[4] = A[0][4] ^ A[1][4] ^ A[2][4] ^ A[3][4] ^ A[4][4]; D[0] = ROL64(C[1], 1) ^ C[4]; D[1] = ROL64(C[2], 1) ^ C[0]; D[2] = ROL64(C[3], 1) ^ C[1]; D[3] = ROL64(C[4], 1) ^ C[2]; D[4] = ROL64(C[0], 1) ^ C[3]; B[0] = A[0][0] ^ D[0]; /* rotate by 0 */ B[1] = ROL64(A[1][1] ^ D[1], rhotates[1][1]); B[2] = ROL64(A[2][2] ^ D[2], rhotates[2][2]); B[3] = ROL64(A[3][3] ^ D[3], rhotates[3][3]); B[4] = ROL64(A[4][4] ^ D[4], rhotates[4][4]); C[0] = A[0][0] = B[0] ^ (~B[1] & B[2]) ^ iotas[i]; C[1] = A[1][1] = B[1] ^ (~B[2] & B[3]); C[2] = A[2][2] = B[2] ^ (~B[3] & B[4]); C[3] = A[3][3] = B[3] ^ (~B[4] & B[0]); C[4] = A[4][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[0][3] ^ D[3], rhotates[0][3]); B[1] = ROL64(A[1][4] ^ D[4], rhotates[1][4]); B[2] = ROL64(A[2][0] ^ D[0], rhotates[2][0]); B[3] = ROL64(A[3][1] ^ D[1], rhotates[3][1]); B[4] = ROL64(A[4][2] ^ D[2], rhotates[4][2]); C[0] ^= A[2][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[3][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[4][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[0][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[1][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[0][1] ^ D[1], rhotates[0][1]); B[1] = ROL64(A[1][2] ^ D[2], rhotates[1][2]); B[2] = ROL64(A[2][3] ^ D[3], rhotates[2][3]); B[3] = ROL64(A[3][4] ^ D[4], rhotates[3][4]); B[4] = ROL64(A[4][0] ^ D[0], rhotates[4][0]); C[0] ^= A[4][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[0][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[1][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[2][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[3][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[0][4] ^ D[4], rhotates[0][4]); B[1] = ROL64(A[1][0] ^ D[0], rhotates[1][0]); B[2] = ROL64(A[2][1] ^ D[1], rhotates[2][1]); B[3] = ROL64(A[3][2] ^ D[2], rhotates[3][2]); B[4] = ROL64(A[4][3] ^ D[3], rhotates[4][3]); C[0] ^= A[1][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[2][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[3][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[4][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[0][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[0][2] ^ D[2], rhotates[0][2]); B[1] = ROL64(A[1][3] ^ D[3], rhotates[1][3]); B[2] = ROL64(A[2][4] ^ D[4], rhotates[2][4]); B[3] = ROL64(A[3][0] ^ D[0], rhotates[3][0]); B[4] = ROL64(A[4][1] ^ D[1], rhotates[4][1]); C[0] ^= A[3][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[4][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[0][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[1][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[2][4] = B[4] ^ (~B[0] & B[1]); /* Round 4*n+1 */ D[0] = ROL64(C[1], 1) ^ C[4]; D[1] = ROL64(C[2], 1) ^ C[0]; D[2] = ROL64(C[3], 1) ^ C[1]; D[3] = ROL64(C[4], 1) ^ C[2]; D[4] = ROL64(C[0], 1) ^ C[3]; B[0] = A[0][0] ^ D[0]; /* rotate by 0 */ B[1] = ROL64(A[3][1] ^ D[1], rhotates[1][1]); B[2] = ROL64(A[1][2] ^ D[2], rhotates[2][2]); B[3] = ROL64(A[4][3] ^ D[3], rhotates[3][3]); B[4] = ROL64(A[2][4] ^ D[4], rhotates[4][4]); C[0] = A[0][0] = B[0] ^ (~B[1] & B[2]) ^ iotas[i + 1]; C[1] = A[3][1] = B[1] ^ (~B[2] & B[3]); C[2] = A[1][2] = B[2] ^ (~B[3] & B[4]); C[3] = A[4][3] = B[3] ^ (~B[4] & B[0]); C[4] = A[2][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[3][3] ^ D[3], rhotates[0][3]); B[1] = ROL64(A[1][4] ^ D[4], rhotates[1][4]); B[2] = ROL64(A[4][0] ^ D[0], rhotates[2][0]); B[3] = ROL64(A[2][1] ^ D[1], rhotates[3][1]); B[4] = ROL64(A[0][2] ^ D[2], rhotates[4][2]); C[0] ^= A[4][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[2][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[0][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[3][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[1][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[1][1] ^ D[1], rhotates[0][1]); B[1] = ROL64(A[4][2] ^ D[2], rhotates[1][2]); B[2] = ROL64(A[2][3] ^ D[3], rhotates[2][3]); B[3] = ROL64(A[0][4] ^ D[4], rhotates[3][4]); B[4] = ROL64(A[3][0] ^ D[0], rhotates[4][0]); C[0] ^= A[3][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[1][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[4][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[2][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[0][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[4][4] ^ D[4], rhotates[0][4]); B[1] = ROL64(A[2][0] ^ D[0], rhotates[1][0]); B[2] = ROL64(A[0][1] ^ D[1], rhotates[2][1]); B[3] = ROL64(A[3][2] ^ D[2], rhotates[3][2]); B[4] = ROL64(A[1][3] ^ D[3], rhotates[4][3]); C[0] ^= A[2][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[0][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[3][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[1][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[4][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[2][2] ^ D[2], rhotates[0][2]); B[1] = ROL64(A[0][3] ^ D[3], rhotates[1][3]); B[2] = ROL64(A[3][4] ^ D[4], rhotates[2][4]); B[3] = ROL64(A[1][0] ^ D[0], rhotates[3][0]); B[4] = ROL64(A[4][1] ^ D[1], rhotates[4][1]); C[0] ^= A[1][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[4][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[2][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[0][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[3][4] = B[4] ^ (~B[0] & B[1]); /* Round 4*n+2 */ D[0] = ROL64(C[1], 1) ^ C[4]; D[1] = ROL64(C[2], 1) ^ C[0]; D[2] = ROL64(C[3], 1) ^ C[1]; D[3] = ROL64(C[4], 1) ^ C[2]; D[4] = ROL64(C[0], 1) ^ C[3]; B[0] = A[0][0] ^ D[0]; /* rotate by 0 */ B[1] = ROL64(A[2][1] ^ D[1], rhotates[1][1]); B[2] = ROL64(A[4][2] ^ D[2], rhotates[2][2]); B[3] = ROL64(A[1][3] ^ D[3], rhotates[3][3]); B[4] = ROL64(A[3][4] ^ D[4], rhotates[4][4]); C[0] = A[0][0] = B[0] ^ (~B[1] & B[2]) ^ iotas[i + 2]; C[1] = A[2][1] = B[1] ^ (~B[2] & B[3]); C[2] = A[4][2] = B[2] ^ (~B[3] & B[4]); C[3] = A[1][3] = B[3] ^ (~B[4] & B[0]); C[4] = A[3][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[4][3] ^ D[3], rhotates[0][3]); B[1] = ROL64(A[1][4] ^ D[4], rhotates[1][4]); B[2] = ROL64(A[3][0] ^ D[0], rhotates[2][0]); B[3] = ROL64(A[0][1] ^ D[1], rhotates[3][1]); B[4] = ROL64(A[2][2] ^ D[2], rhotates[4][2]); C[0] ^= A[3][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[0][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[2][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[4][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[1][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[3][1] ^ D[1], rhotates[0][1]); B[1] = ROL64(A[0][2] ^ D[2], rhotates[1][2]); B[2] = ROL64(A[2][3] ^ D[3], rhotates[2][3]); B[3] = ROL64(A[4][4] ^ D[4], rhotates[3][4]); B[4] = ROL64(A[1][0] ^ D[0], rhotates[4][0]); C[0] ^= A[1][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[3][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[0][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[2][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[4][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[2][4] ^ D[4], rhotates[0][4]); B[1] = ROL64(A[4][0] ^ D[0], rhotates[1][0]); B[2] = ROL64(A[1][1] ^ D[1], rhotates[2][1]); B[3] = ROL64(A[3][2] ^ D[2], rhotates[3][2]); B[4] = ROL64(A[0][3] ^ D[3], rhotates[4][3]); C[0] ^= A[4][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[1][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[3][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[0][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[2][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[1][2] ^ D[2], rhotates[0][2]); B[1] = ROL64(A[3][3] ^ D[3], rhotates[1][3]); B[2] = ROL64(A[0][4] ^ D[4], rhotates[2][4]); B[3] = ROL64(A[2][0] ^ D[0], rhotates[3][0]); B[4] = ROL64(A[4][1] ^ D[1], rhotates[4][1]); C[0] ^= A[2][0] = B[0] ^ (~B[1] & B[2]); C[1] ^= A[4][1] = B[1] ^ (~B[2] & B[3]); C[2] ^= A[1][2] = B[2] ^ (~B[3] & B[4]); C[3] ^= A[3][3] = B[3] ^ (~B[4] & B[0]); C[4] ^= A[0][4] = B[4] ^ (~B[0] & B[1]); /* Round 4*n+3 */ D[0] = ROL64(C[1], 1) ^ C[4]; D[1] = ROL64(C[2], 1) ^ C[0]; D[2] = ROL64(C[3], 1) ^ C[1]; D[3] = ROL64(C[4], 1) ^ C[2]; D[4] = ROL64(C[0], 1) ^ C[3]; B[0] = A[0][0] ^ D[0]; /* rotate by 0 */ B[1] = ROL64(A[0][1] ^ D[1], rhotates[1][1]); B[2] = ROL64(A[0][2] ^ D[2], rhotates[2][2]); B[3] = ROL64(A[0][3] ^ D[3], rhotates[3][3]); B[4] = ROL64(A[0][4] ^ D[4], rhotates[4][4]); /* C[0] = */ A[0][0] = B[0] ^ (~B[1] & B[2]) ^ iotas[i + 3]; /* C[1] = */ A[0][1] = B[1] ^ (~B[2] & B[3]); /* C[2] = */ A[0][2] = B[2] ^ (~B[3] & B[4]); /* C[3] = */ A[0][3] = B[3] ^ (~B[4] & B[0]); /* C[4] = */ A[0][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[1][3] ^ D[3], rhotates[0][3]); B[1] = ROL64(A[1][4] ^ D[4], rhotates[1][4]); B[2] = ROL64(A[1][0] ^ D[0], rhotates[2][0]); B[3] = ROL64(A[1][1] ^ D[1], rhotates[3][1]); B[4] = ROL64(A[1][2] ^ D[2], rhotates[4][2]); /* C[0] ^= */ A[1][0] = B[0] ^ (~B[1] & B[2]); /* C[1] ^= */ A[1][1] = B[1] ^ (~B[2] & B[3]); /* C[2] ^= */ A[1][2] = B[2] ^ (~B[3] & B[4]); /* C[3] ^= */ A[1][3] = B[3] ^ (~B[4] & B[0]); /* C[4] ^= */ A[1][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[2][1] ^ D[1], rhotates[0][1]); B[1] = ROL64(A[2][2] ^ D[2], rhotates[1][2]); B[2] = ROL64(A[2][3] ^ D[3], rhotates[2][3]); B[3] = ROL64(A[2][4] ^ D[4], rhotates[3][4]); B[4] = ROL64(A[2][0] ^ D[0], rhotates[4][0]); /* C[0] ^= */ A[2][0] = B[0] ^ (~B[1] & B[2]); /* C[1] ^= */ A[2][1] = B[1] ^ (~B[2] & B[3]); /* C[2] ^= */ A[2][2] = B[2] ^ (~B[3] & B[4]); /* C[3] ^= */ A[2][3] = B[3] ^ (~B[4] & B[0]); /* C[4] ^= */ A[2][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[3][4] ^ D[4], rhotates[0][4]); B[1] = ROL64(A[3][0] ^ D[0], rhotates[1][0]); B[2] = ROL64(A[3][1] ^ D[1], rhotates[2][1]); B[3] = ROL64(A[3][2] ^ D[2], rhotates[3][2]); B[4] = ROL64(A[3][3] ^ D[3], rhotates[4][3]); /* C[0] ^= */ A[3][0] = B[0] ^ (~B[1] & B[2]); /* C[1] ^= */ A[3][1] = B[1] ^ (~B[2] & B[3]); /* C[2] ^= */ A[3][2] = B[2] ^ (~B[3] & B[4]); /* C[3] ^= */ A[3][3] = B[3] ^ (~B[4] & B[0]); /* C[4] ^= */ A[3][4] = B[4] ^ (~B[0] & B[1]); B[0] = ROL64(A[4][2] ^ D[2], rhotates[0][2]); B[1] = ROL64(A[4][3] ^ D[3], rhotates[1][3]); B[2] = ROL64(A[4][4] ^ D[4], rhotates[2][4]); B[3] = ROL64(A[4][0] ^ D[0], rhotates[3][0]); B[4] = ROL64(A[4][1] ^ D[1], rhotates[4][1]); /* C[0] ^= */ A[4][0] = B[0] ^ (~B[1] & B[2]); /* C[1] ^= */ A[4][1] = B[1] ^ (~B[2] & B[3]); /* C[2] ^= */ A[4][2] = B[2] ^ (~B[3] & B[4]); /* C[3] ^= */ A[4][3] = B[3] ^ (~B[4] & B[0]); /* C[4] ^= */ A[4][4] = B[4] ^ (~B[0] & B[1]); } void KeccakF1600(uint64_t A[5][5]) { size_t i; for (i = 0; i < 24; i += 4) { FourRounds(A, i); } } #endif static uint64_t BitInterleave(uint64_t Ai) { if (sizeof(void *) < 8) { uint32_t hi = 0, lo = 0; int j; for (j = 0; j < 32; j++) { lo |= ((uint32_t)(Ai >> (2 * j)) & 1) << j; hi |= ((uint32_t)(Ai >> (2 * j + 1)) & 1) << j; } Ai = ((uint64_t)hi << 32) | lo; } return Ai; } static uint64_t BitDeinterleave(uint64_t Ai) { if (sizeof(void *) < 8) { uint32_t hi = (uint32_t)(Ai >> 32), lo = (uint32_t)Ai; int j; Ai = 0; for (j = 0; j < 32; j++) { Ai |= (uint64_t)((lo >> j) & 1) << (2 * j); Ai |= (uint64_t)((hi >> j) & 1) << (2 * j + 1); } } return Ai; } /* * SHA3_absorb can be called multiple times, but at each invocation * largest multiple of |r| out of |len| bytes are processed. Then * remaining amount of bytes is returned. This is done to spare caller * trouble of calculating the largest multiple of |r|. |r| can be viewed * as blocksize. It is commonly (1600 - 256*n)/8, e.g. 168, 136, 104, * 72, but can also be (1600 - 448)/8 = 144. All this means that message * padding and intermediate sub-block buffering, byte- or bitwise, is * caller's reponsibility. */ size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len, size_t r) { uint64_t *A_flat = (uint64_t *)A; size_t i, w = r / 8; assert(r < (25 * sizeof(A[0][0])) && (r % 8) == 0); while (len >= r) { for (i = 0; i < w; i++) { uint64_t Ai = (uint64_t)inp[0] | (uint64_t)inp[1] << 8 | (uint64_t)inp[2] << 16 | (uint64_t)inp[3] << 24 | (uint64_t)inp[4] << 32 | (uint64_t)inp[5] << 40 | (uint64_t)inp[6] << 48 | (uint64_t)inp[7] << 56; inp += 8; A_flat[i] ^= BitInterleave(Ai); } KeccakF1600(A); len -= r; } return len; } /* * SHA3_squeeze is called once at the end to generate |out| hash value * of |len| bytes. */ void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r) { uint64_t *A_flat = (uint64_t *)A; size_t i, rem, w = r / 8; assert(r < (25 * sizeof(A[0][0])) && (r % 8) == 0); while (len >= r) { for (i = 0; i < w; i++) { uint64_t Ai = BitDeinterleave(A_flat[i]); out[0] = (unsigned char)(Ai); out[1] = (unsigned char)(Ai >> 8); out[2] = (unsigned char)(Ai >> 16); out[3] = (unsigned char)(Ai >> 24); out[4] = (unsigned char)(Ai >> 32); out[5] = (unsigned char)(Ai >> 40); out[6] = (unsigned char)(Ai >> 48); out[7] = (unsigned char)(Ai >> 56); out += 8; } len -= r; if (len) KeccakF1600(A); } rem = len % 8; len /= 8; for (i = 0; i < len; i++) { uint64_t Ai = BitDeinterleave(A_flat[i]); out[0] = (unsigned char)(Ai); out[1] = (unsigned char)(Ai >> 8); out[2] = (unsigned char)(Ai >> 16); out[3] = (unsigned char)(Ai >> 24); out[4] = (unsigned char)(Ai >> 32); out[5] = (unsigned char)(Ai >> 40); out[6] = (unsigned char)(Ai >> 48); out[7] = (unsigned char)(Ai >> 56); out += 8; } if (rem) { uint64_t Ai = BitDeinterleave(A_flat[i]); for (i = 0; i < rem; i++) { *out++ = (unsigned char)Ai; Ai >>= 8; } } } #else size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len, size_t r); void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r); #endif #ifdef SELFTEST /* * Post-padding one-shot implementations would look as following: * * SHA3_224 SHA3_sponge(inp, len, out, 224/8, (1600-448)/8); * SHA3_256 SHA3_sponge(inp, len, out, 256/8, (1600-512)/8); * SHA3_384 SHA3_sponge(inp, len, out, 384/8, (1600-768)/8); * SHA3_512 SHA3_sponge(inp, len, out, 512/8, (1600-1024)/8); * SHAKE_128 SHA3_sponge(inp, len, out, d, (1600-256)/8); * SHAKE_256 SHA3_sponge(inp, len, out, d, (1600-512)/8); */ void SHA3_sponge(const unsigned char *inp, size_t len, unsigned char *out, size_t d, size_t r) { uint64_t A[5][5]; memset(A, 0, sizeof(A)); SHA3_absorb(A, inp, len, r); SHA3_squeeze(A, out, d, r); } # include <stdio.h> int main() { /* * This is 5-bit SHAKE128 test from http://csrc.nist.gov/groups/ST/toolkit/examples.html#aHashing */ unsigned char test[168] = { '\xf3', '\x3' }; unsigned char out[512]; size_t i; static const unsigned char result[512] = { 0x2E, 0x0A, 0xBF, 0xBA, 0x83, 0xE6, 0x72, 0x0B, 0xFB, 0xC2, 0x25, 0xFF, 0x6B, 0x7A, 0xB9, 0xFF, 0xCE, 0x58, 0xBA, 0x02, 0x7E, 0xE3, 0xD8, 0x98, 0x76, 0x4F, 0xEF, 0x28, 0x7D, 0xDE, 0xCC, 0xCA, 0x3E, 0x6E, 0x59, 0x98, 0x41, 0x1E, 0x7D, 0xDB, 0x32, 0xF6, 0x75, 0x38, 0xF5, 0x00, 0xB1, 0x8C, 0x8C, 0x97, 0xC4, 0x52, 0xC3, 0x70, 0xEA, 0x2C, 0xF0, 0xAF, 0xCA, 0x3E, 0x05, 0xDE, 0x7E, 0x4D, 0xE2, 0x7F, 0xA4, 0x41, 0xA9, 0xCB, 0x34, 0xFD, 0x17, 0xC9, 0x78, 0xB4, 0x2D, 0x5B, 0x7E, 0x7F, 0x9A, 0xB1, 0x8F, 0xFE, 0xFF, 0xC3, 0xC5, 0xAC, 0x2F, 0x3A, 0x45, 0x5E, 0xEB, 0xFD, 0xC7, 0x6C, 0xEA, 0xEB, 0x0A, 0x2C, 0xCA, 0x22, 0xEE, 0xF6, 0xE6, 0x37, 0xF4, 0xCA, 0xBE, 0x5C, 0x51, 0xDE, 0xD2, 0xE3, 0xFA, 0xD8, 0xB9, 0x52, 0x70, 0xA3, 0x21, 0x84, 0x56, 0x64, 0xF1, 0x07, 0xD1, 0x64, 0x96, 0xBB, 0x7A, 0xBF, 0xBE, 0x75, 0x04, 0xB6, 0xED, 0xE2, 0xE8, 0x9E, 0x4B, 0x99, 0x6F, 0xB5, 0x8E, 0xFD, 0xC4, 0x18, 0x1F, 0x91, 0x63, 0x38, 0x1C, 0xBE, 0x7B, 0xC0, 0x06, 0xA7, 0xA2, 0x05, 0x98, 0x9C, 0x52, 0x6C, 0xD1, 0xBD, 0x68, 0x98, 0x36, 0x93, 0xB4, 0xBD, 0xC5, 0x37, 0x28, 0xB2, 0x41, 0xC1, 0xCF, 0xF4, 0x2B, 0xB6, 0x11, 0x50, 0x2C, 0x35, 0x20, 0x5C, 0xAB, 0xB2, 0x88, 0x75, 0x56, 0x55, 0xD6, 0x20, 0xC6, 0x79, 0x94, 0xF0, 0x64, 0x51, 0x18, 0x7F, 0x6F, 0xD1, 0x7E, 0x04, 0x66, 0x82, 0xBA, 0x12, 0x86, 0x06, 0x3F, 0xF8, 0x8F, 0xE2, 0x50, 0x8D, 0x1F, 0xCA, 0xF9, 0x03, 0x5A, 0x12, 0x31, 0xAD, 0x41, 0x50, 0xA9, 0xC9, 0xB2, 0x4C, 0x9B, 0x2D, 0x66, 0xB2, 0xAD, 0x1B, 0xDE, 0x0B, 0xD0, 0xBB, 0xCB, 0x8B, 0xE0, 0x5B, 0x83, 0x52, 0x29, 0xEF, 0x79, 0x19, 0x73, 0x73, 0x23, 0x42, 0x44, 0x01, 0xE1, 0xD8, 0x37, 0xB6, 0x6E, 0xB4, 0xE6, 0x30, 0xFF, 0x1D, 0xE7, 0x0C, 0xB3, 0x17, 0xC2, 0xBA, 0xCB, 0x08, 0x00, 0x1D, 0x34, 0x77, 0xB7, 0xA7, 0x0A, 0x57, 0x6D, 0x20, 0x86, 0x90, 0x33, 0x58, 0x9D, 0x85, 0xA0, 0x1D, 0xDB, 0x2B, 0x66, 0x46, 0xC0, 0x43, 0xB5, 0x9F, 0xC0, 0x11, 0x31, 0x1D, 0xA6, 0x66, 0xFA, 0x5A, 0xD1, 0xD6, 0x38, 0x7F, 0xA9, 0xBC, 0x40, 0x15, 0xA3, 0x8A, 0x51, 0xD1, 0xDA, 0x1E, 0xA6, 0x1D, 0x64, 0x8D, 0xC8, 0xE3, 0x9A, 0x88, 0xB9, 0xD6, 0x22, 0xBD, 0xE2, 0x07, 0xFD, 0xAB, 0xC6, 0xF2, 0x82, 0x7A, 0x88, 0x0C, 0x33, 0x0B, 0xBF, 0x6D, 0xF7, 0x33, 0x77, 0x4B, 0x65, 0x3E, 0x57, 0x30, 0x5D, 0x78, 0xDC, 0xE1, 0x12, 0xF1, 0x0A, 0x2C, 0x71, 0xF4, 0xCD, 0xAD, 0x92, 0xED, 0x11, 0x3E, 0x1C, 0xEA, 0x63, 0xB9, 0x19, 0x25, 0xED, 0x28, 0x19, 0x1E, 0x6D, 0xBB, 0xB5, 0xAA, 0x5A, 0x2A, 0xFD, 0xA5, 0x1F, 0xC0, 0x5A, 0x3A, 0xF5, 0x25, 0x8B, 0x87, 0x66, 0x52, 0x43, 0x55, 0x0F, 0x28, 0x94, 0x8A, 0xE2, 0xB8, 0xBE, 0xB6, 0xBC, 0x9C, 0x77, 0x0B, 0x35, 0xF0, 0x67, 0xEA, 0xA6, 0x41, 0xEF, 0xE6, 0x5B, 0x1A, 0x44, 0x90, 0x9D, 0x1B, 0x14, 0x9F, 0x97, 0xEE, 0xA6, 0x01, 0x39, 0x1C, 0x60, 0x9E, 0xC8, 0x1D, 0x19, 0x30, 0xF5, 0x7C, 0x18, 0xA4, 0xE0, 0xFA, 0xB4, 0x91, 0xD1, 0xCA, 0xDF, 0xD5, 0x04, 0x83, 0x44, 0x9E, 0xDC, 0x0F, 0x07, 0xFF, 0xB2, 0x4D, 0x2C, 0x6F, 0x9A, 0x9A, 0x3B, 0xFF, 0x39, 0xAE, 0x3D, 0x57, 0xF5, 0x60, 0x65, 0x4D, 0x7D, 0x75, 0xC9, 0x08, 0xAB, 0xE6, 0x25, 0x64, 0x75, 0x3E, 0xAC, 0x39, 0xD7, 0x50, 0x3D, 0xA6, 0xD3, 0x7C, 0x2E, 0x32, 0xE1, 0xAF, 0x3B, 0x8A, 0xEC, 0x8A, 0xE3, 0x06, 0x9C, 0xD9 }; test[167] = '\x80'; SHA3_sponge(test, sizeof(test), out, sizeof(out), sizeof(test)); /* * Rationale behind keeping output [formatted as below] is that * one should be able to redirect it to a file, then copy-n-paste * final "output val" from official example to another file, and * compare the two with diff(1). */ for (i = 0; i < sizeof(out);) { printf("%02X", out[i]); printf(++i % 16 && i != sizeof(out) ? " " : "\n"); } if (memcmp(out,result,sizeof(out))) { fprintf(stderr,"failure\n"); return 1; } else { fprintf(stderr,"success\n"); return 0; } } #endif
the_stack_data/34514045.c
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -ast-dump %s | FileCheck --match-full-lines -implicit-check-not=openmp_structured_block %s void test_one(int x) { #pragma omp target #pragma omp teams distribute parallel for simd for (int i = 0; i < x; i++) ; } void test_two(int x, int y) { #pragma omp target #pragma omp teams distribute parallel for simd for (int i = 0; i < x; i++) for (int i = 0; i < y; i++) ; } void test_three(int x, int y) { #pragma omp target #pragma omp teams distribute parallel for simd collapse(1) for (int i = 0; i < x; i++) for (int i = 0; i < y; i++) ; } void test_four(int x, int y) { #pragma omp target #pragma omp teams distribute parallel for simd collapse(2) for (int i = 0; i < x; i++) for (int i = 0; i < y; i++) ; } void test_five(int x, int y, int z) { #pragma omp target #pragma omp teams distribute parallel for simd collapse(2) for (int i = 0; i < x; i++) for (int i = 0; i < y; i++) for (int i = 0; i < z; i++) ; } // CHECK: TranslationUnitDecl {{.*}} <<invalid sloc>> <invalid sloc> // CHECK: |-FunctionDecl {{.*}} <{{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:3:1, line:8:1> line:3:6 test_one 'void (int)' // CHECK-NEXT: | |-ParmVarDecl {{.*}} <col:15, col:19> col:19 used x 'int' // CHECK-NEXT: | `-CompoundStmt {{.*}} <col:22, line:8:1> // CHECK-NEXT: | `-OMPTargetDirective {{.*}} <line:4:9, col:19> // CHECK-NEXT: | |-OMPFirstprivateClause {{.*}} <<invalid sloc>> <implicit> // CHECK-NEXT: | | `-DeclRefExpr {{.*}} <line:6:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | `-CapturedStmt {{.*}} <line:5:9, col:47> // CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | |-CapturedStmt {{.*}} <col:9, col:47> // CHECK-NEXT: | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-OMPTeamsDistributeParallelForSimdDirective {{.*}} <col:9, col:47> openmp_structured_block // CHECK-NEXT: | | | | | `-CapturedStmt {{.*}} <line:6:3, line:7:5> // CHECK-NEXT: | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-CapturedStmt {{.*}} <line:6:3, line:7:5> // CHECK-NEXT: | | | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | | | |-ForStmt {{.*}} <line:6:3, line:7:5> // CHECK-NEXT: | | | | | | | | | |-DeclStmt {{.*}} <line:6:8, col:17> // CHECK-NEXT: | | | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} <line:7:5> openmp_structured_block // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <line:6:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | | | `-FieldDecl {{.*}} <line:6:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-ForStmt {{.*}} <col:3, line:7:5> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:6:8, col:17> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} <line:7:5> openmp_structured_block // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <line:6:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:4:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:4:9) *const restrict' // CHECK-NEXT: | | | | |-RecordDecl {{.*}} <line:5:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | `-FieldDecl {{.*}} <line:6:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-CapturedStmt {{.*}} <col:3, line:7:5> // CHECK-NEXT: | | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | | |-ForStmt {{.*}} <line:6:3, line:7:5> // CHECK-NEXT: | | | | | | | | |-DeclStmt {{.*}} <line:6:8, col:17> // CHECK-NEXT: | | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} <line:7:5> openmp_structured_block // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <line:6:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | | `-FieldDecl {{.*}} <line:6:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-ForStmt {{.*}} <col:3, line:7:5> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:6:8, col:17> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} <line:7:5> openmp_structured_block // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <line:6:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | |-OMPCapturedExprDecl {{.*}} <col:23> col:23 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | `-OMPCapturedExprDecl {{.*}} <col:3, <invalid sloc>> col:3 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} <col:3, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:3, col:26> 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} <col:3> 'int' // CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} <col:23, col:26> 'int' '+' // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:23, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:23, col:16> 'int' '-' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | |-AlwaysInlineAttr {{.*}} <<invalid sloc>> Implicit __forceinline // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:4:9> col:9 implicit .global_tid. 'const int' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .part_id. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .privates. 'void *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .copy_fn. 'void (*const restrict)(void *const restrict, ...)' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .task_t. 'void *const' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:4:9) *const restrict' // CHECK-NEXT: | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | `-FieldDecl {{.*}} <line:6:23> col:23 implicit 'int' // CHECK-NEXT: | | | `-OMPCaptureKindAttr {{.*}} <<invalid sloc>> Implicit 9 // CHECK-NEXT: | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | |-OMPTeamsDistributeParallelForSimdDirective {{.*}} <line:5:9, col:47> openmp_structured_block // CHECK-NEXT: | | | `-CapturedStmt {{.*}} <line:6:3, line:7:5> // CHECK-NEXT: | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-CapturedStmt {{.*}} <line:6:3, line:7:5> // CHECK-NEXT: | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-ForStmt {{.*}} <line:6:3, line:7:5> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:6:8, col:17> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} <line:7:5> openmp_structured_block // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <line:6:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | `-FieldDecl {{.*}} <line:6:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-ForStmt {{.*}} <col:3, line:7:5> // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:6:8, col:17> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-NullStmt {{.*}} <line:7:5> openmp_structured_block // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | | `-VarDecl {{.*}} <line:6:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:4:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:4:9) *const restrict' // CHECK-NEXT: | | |-RecordDecl {{.*}} <line:5:9> col:9 implicit struct definition // CHECK-NEXT: | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | `-FieldDecl {{.*}} <line:6:23> col:23 implicit 'int &' // CHECK-NEXT: | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | |-CapturedStmt {{.*}} <col:3, line:7:5> // CHECK-NEXT: | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-ForStmt {{.*}} <line:6:3, line:7:5> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:6:8, col:17> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} <line:7:5> openmp_structured_block // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <line:6:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | `-FieldDecl {{.*}} <line:6:23> col:23 implicit 'int &' // CHECK-NEXT: | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | |-ForStmt {{.*}} <col:3, line:7:5> // CHECK-NEXT: | | | | |-DeclStmt {{.*}} <line:6:8, col:17> // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-NullStmt {{.*}} <line:7:5> openmp_structured_block // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <line:5:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:9) *const restrict' // CHECK-NEXT: | | | `-VarDecl {{.*}} <line:6:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | |-OMPCapturedExprDecl {{.*}} <col:23> col:23 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | `-OMPCapturedExprDecl {{.*}} <col:3, <invalid sloc>> col:3 implicit used .capture_expr. 'int' // CHECK-NEXT: | | `-BinaryOperator {{.*}} <col:3, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} <col:3, col:26> 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} <col:3> 'int' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} <col:23, col:26> 'int' '+' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:23, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:23, col:16> 'int' '-' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: |-FunctionDecl {{.*}} <line:10:1, line:16:1> line:10:6 test_two 'void (int, int)' // CHECK-NEXT: | |-ParmVarDecl {{.*}} <col:15, col:19> col:19 used x 'int' // CHECK-NEXT: | |-ParmVarDecl {{.*}} <col:22, col:26> col:26 used y 'int' // CHECK-NEXT: | `-CompoundStmt {{.*}} <col:29, line:16:1> // CHECK-NEXT: | `-OMPTargetDirective {{.*}} <line:11:9, col:19> // CHECK-NEXT: | |-OMPFirstprivateClause {{.*}} <<invalid sloc>> <implicit> // CHECK-NEXT: | | |-DeclRefExpr {{.*}} <line:13:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | `-DeclRefExpr {{.*}} <line:14:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | `-CapturedStmt {{.*}} <line:12:9, col:47> // CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | |-CapturedStmt {{.*}} <col:9, col:47> // CHECK-NEXT: | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-OMPTeamsDistributeParallelForSimdDirective {{.*}} <col:9, col:47> openmp_structured_block // CHECK-NEXT: | | | | | `-CapturedStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-CapturedStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | | | |-ForStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | | | | | | |-DeclStmt {{.*}} <line:13:8, col:17> // CHECK-NEXT: | | | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ForStmt {{.*}} <line:14:5, line:15:7> openmp_structured_block // CHECK-NEXT: | | | | | | | | | |-DeclStmt {{.*}} <line:14:10, col:19> // CHECK-NEXT: | | | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} <line:15:7> // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} <line:13:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <line:14:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | |-DeclRefExpr {{.*}} <line:13:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <line:14:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | | | |-FieldDecl {{.*}} <line:13:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | | | `-FieldDecl {{.*}} <line:14:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-ForStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:13:8, col:17> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ForStmt {{.*}} <line:14:5, line:15:7> openmp_structured_block // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:14:10, col:19> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} <line:15:7> // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} <line:13:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <line:14:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | |-DeclRefExpr {{.*}} <line:13:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <line:14:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:11:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:11:9) *const restrict' // CHECK-NEXT: | | | | |-RecordDecl {{.*}} <line:12:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | |-FieldDecl {{.*}} <line:13:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | `-FieldDecl {{.*}} <line:14:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-CapturedStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | | |-ForStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | | | | | |-DeclStmt {{.*}} <line:13:8, col:17> // CHECK-NEXT: | | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ForStmt {{.*}} <line:14:5, line:15:7> openmp_structured_block // CHECK-NEXT: | | | | | | | | |-DeclStmt {{.*}} <line:14:10, col:19> // CHECK-NEXT: | | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} <line:15:7> // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} <line:13:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <line:14:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | |-DeclRefExpr {{.*}} <line:13:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <line:14:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | | |-FieldDecl {{.*}} <line:13:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | | `-FieldDecl {{.*}} <line:14:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-ForStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:13:8, col:17> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ForStmt {{.*}} <line:14:5, line:15:7> openmp_structured_block // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:14:10, col:19> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} <line:15:7> // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} <line:13:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <line:14:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | |-OMPCapturedExprDecl {{.*}} <line:13:23> col:23 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | `-OMPCapturedExprDecl {{.*}} <col:3, <invalid sloc>> col:3 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} <col:3, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:3, col:26> 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} <col:3> 'int' // CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} <col:23, col:26> 'int' '+' // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:23, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:23, col:16> 'int' '-' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <line:14:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | |-AlwaysInlineAttr {{.*}} <<invalid sloc>> Implicit __forceinline // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:11:9> col:9 implicit .global_tid. 'const int' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .part_id. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .privates. 'void *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .copy_fn. 'void (*const restrict)(void *const restrict, ...)' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .task_t. 'void *const' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:11:9) *const restrict' // CHECK-NEXT: | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | |-FieldDecl {{.*}} <line:13:23> col:23 implicit 'int' // CHECK-NEXT: | | | | `-OMPCaptureKindAttr {{.*}} <<invalid sloc>> Implicit 9 // CHECK-NEXT: | | | `-FieldDecl {{.*}} <line:14:25> col:25 implicit 'int' // CHECK-NEXT: | | | `-OMPCaptureKindAttr {{.*}} <<invalid sloc>> Implicit 9 // CHECK-NEXT: | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | |-OMPTeamsDistributeParallelForSimdDirective {{.*}} <line:12:9, col:47> openmp_structured_block // CHECK-NEXT: | | | `-CapturedStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-CapturedStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-ForStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:13:8, col:17> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ForStmt {{.*}} <line:14:5, line:15:7> openmp_structured_block // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:14:10, col:19> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} <line:15:7> // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} <line:13:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <line:14:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | |-DeclRefExpr {{.*}} <line:13:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <line:14:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | |-FieldDecl {{.*}} <line:13:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | `-FieldDecl {{.*}} <line:14:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-ForStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:13:8, col:17> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ForStmt {{.*}} <line:14:5, line:15:7> openmp_structured_block // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:14:10, col:19> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-NullStmt {{.*}} <line:15:7> // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} <line:13:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | `-VarDecl {{.*}} <line:14:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} <line:13:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <line:14:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:11:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:11:9) *const restrict' // CHECK-NEXT: | | |-RecordDecl {{.*}} <line:12:9> col:9 implicit struct definition // CHECK-NEXT: | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | |-FieldDecl {{.*}} <line:13:23> col:23 implicit 'int &' // CHECK-NEXT: | | | `-FieldDecl {{.*}} <line:14:25> col:25 implicit 'int &' // CHECK-NEXT: | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | |-CapturedStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-ForStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:13:8, col:17> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ForStmt {{.*}} <line:14:5, line:15:7> openmp_structured_block // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:14:10, col:19> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} <line:15:7> // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} <line:13:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <line:14:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | |-DeclRefExpr {{.*}} <line:13:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <line:14:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | |-FieldDecl {{.*}} <line:13:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | `-FieldDecl {{.*}} <line:14:25> col:25 implicit 'int &' // CHECK-NEXT: | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | |-ForStmt {{.*}} <line:13:3, line:15:7> // CHECK-NEXT: | | | | |-DeclStmt {{.*}} <line:13:8, col:17> // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-ForStmt {{.*}} <line:14:5, line:15:7> openmp_structured_block // CHECK-NEXT: | | | | |-DeclStmt {{.*}} <line:14:10, col:19> // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-NullStmt {{.*}} <line:15:7> // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <line:12:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:9) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} <line:13:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | `-VarDecl {{.*}} <line:14:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | |-OMPCapturedExprDecl {{.*}} <line:13:23> col:23 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | `-OMPCapturedExprDecl {{.*}} <col:3, <invalid sloc>> col:3 implicit used .capture_expr. 'int' // CHECK-NEXT: | | `-BinaryOperator {{.*}} <col:3, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} <col:3, col:26> 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} <col:3> 'int' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} <col:23, col:26> 'int' '+' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:23, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:23, col:16> 'int' '-' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | |-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | `-DeclRefExpr {{.*}} <line:14:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: |-FunctionDecl {{.*}} <line:18:1, line:24:1> line:18:6 test_three 'void (int, int)' // CHECK-NEXT: | |-ParmVarDecl {{.*}} <col:17, col:21> col:21 used x 'int' // CHECK-NEXT: | |-ParmVarDecl {{.*}} <col:24, col:28> col:28 used y 'int' // CHECK-NEXT: | `-CompoundStmt {{.*}} <col:31, line:24:1> // CHECK-NEXT: | `-OMPTargetDirective {{.*}} <line:19:9, col:19> // CHECK-NEXT: | |-OMPFirstprivateClause {{.*}} <<invalid sloc>> <implicit> // CHECK-NEXT: | | |-DeclRefExpr {{.*}} <line:21:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | `-DeclRefExpr {{.*}} <line:22:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | `-CapturedStmt {{.*}} <line:20:9, col:59> // CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | |-CapturedStmt {{.*}} <col:9, col:59> // CHECK-NEXT: | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-OMPTeamsDistributeParallelForSimdDirective {{.*}} <col:9, col:59> openmp_structured_block // CHECK-NEXT: | | | | | |-OMPCollapseClause {{.*}} <col:48, col:58> // CHECK-NEXT: | | | | | | `-ConstantExpr {{.*}} <col:57> 'int' // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:57> 'int' 1 // CHECK-NEXT: | | | | | `-CapturedStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-CapturedStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | | | |-ForStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | | | | | | |-DeclStmt {{.*}} <line:21:8, col:17> // CHECK-NEXT: | | | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ForStmt {{.*}} <line:22:5, line:23:7> openmp_structured_block // CHECK-NEXT: | | | | | | | | | |-DeclStmt {{.*}} <line:22:10, col:19> // CHECK-NEXT: | | | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} <line:23:7> // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} <line:21:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <line:22:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | |-DeclRefExpr {{.*}} <line:21:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <line:22:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | | | |-FieldDecl {{.*}} <line:21:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | | | `-FieldDecl {{.*}} <line:22:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-ForStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:21:8, col:17> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ForStmt {{.*}} <line:22:5, line:23:7> openmp_structured_block // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:22:10, col:19> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} <line:23:7> // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} <line:21:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <line:22:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | |-DeclRefExpr {{.*}} <line:21:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <line:22:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:19:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:19:9) *const restrict' // CHECK-NEXT: | | | | |-RecordDecl {{.*}} <line:20:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | |-FieldDecl {{.*}} <line:21:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | `-FieldDecl {{.*}} <line:22:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-CapturedStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | | |-ForStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | | | | | |-DeclStmt {{.*}} <line:21:8, col:17> // CHECK-NEXT: | | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ForStmt {{.*}} <line:22:5, line:23:7> openmp_structured_block // CHECK-NEXT: | | | | | | | | |-DeclStmt {{.*}} <line:22:10, col:19> // CHECK-NEXT: | | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} <line:23:7> // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} <line:21:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <line:22:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | |-DeclRefExpr {{.*}} <line:21:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <line:22:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | | |-FieldDecl {{.*}} <line:21:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | | `-FieldDecl {{.*}} <line:22:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-ForStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:21:8, col:17> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ForStmt {{.*}} <line:22:5, line:23:7> openmp_structured_block // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:22:10, col:19> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} <line:23:7> // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} <line:21:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <line:22:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | |-OMPCapturedExprDecl {{.*}} <line:21:23> col:23 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | `-OMPCapturedExprDecl {{.*}} <col:3, <invalid sloc>> col:3 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} <col:3, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:3, col:26> 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} <col:3> 'int' // CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} <col:23, col:26> 'int' '+' // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:23, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:23, col:16> 'int' '-' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <line:22:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | |-AlwaysInlineAttr {{.*}} <<invalid sloc>> Implicit __forceinline // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:19:9> col:9 implicit .global_tid. 'const int' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .part_id. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .privates. 'void *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .copy_fn. 'void (*const restrict)(void *const restrict, ...)' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .task_t. 'void *const' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:19:9) *const restrict' // CHECK-NEXT: | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | |-FieldDecl {{.*}} <line:21:23> col:23 implicit 'int' // CHECK-NEXT: | | | | `-OMPCaptureKindAttr {{.*}} <<invalid sloc>> Implicit 9 // CHECK-NEXT: | | | `-FieldDecl {{.*}} <line:22:25> col:25 implicit 'int' // CHECK-NEXT: | | | `-OMPCaptureKindAttr {{.*}} <<invalid sloc>> Implicit 9 // CHECK-NEXT: | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | |-OMPTeamsDistributeParallelForSimdDirective {{.*}} <line:20:9, col:59> openmp_structured_block // CHECK-NEXT: | | | |-OMPCollapseClause {{.*}} <col:48, col:58> // CHECK-NEXT: | | | | `-ConstantExpr {{.*}} <col:57> 'int' // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:57> 'int' 1 // CHECK-NEXT: | | | `-CapturedStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-CapturedStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-ForStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:21:8, col:17> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ForStmt {{.*}} <line:22:5, line:23:7> openmp_structured_block // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:22:10, col:19> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} <line:23:7> // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} <line:21:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <line:22:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | |-DeclRefExpr {{.*}} <line:21:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <line:22:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | |-FieldDecl {{.*}} <line:21:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | `-FieldDecl {{.*}} <line:22:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-ForStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:21:8, col:17> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ForStmt {{.*}} <line:22:5, line:23:7> openmp_structured_block // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:22:10, col:19> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-NullStmt {{.*}} <line:23:7> // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} <line:21:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | `-VarDecl {{.*}} <line:22:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} <line:21:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <line:22:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:19:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:19:9) *const restrict' // CHECK-NEXT: | | |-RecordDecl {{.*}} <line:20:9> col:9 implicit struct definition // CHECK-NEXT: | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | |-FieldDecl {{.*}} <line:21:23> col:23 implicit 'int &' // CHECK-NEXT: | | | `-FieldDecl {{.*}} <line:22:25> col:25 implicit 'int &' // CHECK-NEXT: | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | |-CapturedStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-ForStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:21:8, col:17> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ForStmt {{.*}} <line:22:5, line:23:7> openmp_structured_block // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:22:10, col:19> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} <line:23:7> // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} <line:21:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <line:22:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | |-DeclRefExpr {{.*}} <line:21:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <line:22:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | |-FieldDecl {{.*}} <line:21:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | `-FieldDecl {{.*}} <line:22:25> col:25 implicit 'int &' // CHECK-NEXT: | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | |-ForStmt {{.*}} <line:21:3, line:23:7> // CHECK-NEXT: | | | | |-DeclStmt {{.*}} <line:21:8, col:17> // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-ForStmt {{.*}} <line:22:5, line:23:7> openmp_structured_block // CHECK-NEXT: | | | | |-DeclStmt {{.*}} <line:22:10, col:19> // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-NullStmt {{.*}} <line:23:7> // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <line:20:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:9) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} <line:21:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | `-VarDecl {{.*}} <line:22:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | |-OMPCapturedExprDecl {{.*}} <line:21:23> col:23 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | `-OMPCapturedExprDecl {{.*}} <col:3, <invalid sloc>> col:3 implicit used .capture_expr. 'int' // CHECK-NEXT: | | `-BinaryOperator {{.*}} <col:3, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} <col:3, col:26> 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} <col:3> 'int' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} <col:23, col:26> 'int' '+' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:23, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:23, col:16> 'int' '-' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | |-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | `-DeclRefExpr {{.*}} <line:22:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: |-FunctionDecl {{.*}} <line:26:1, line:32:1> line:26:6 test_four 'void (int, int)' // CHECK-NEXT: | |-ParmVarDecl {{.*}} <col:16, col:20> col:20 used x 'int' // CHECK-NEXT: | |-ParmVarDecl {{.*}} <col:23, col:27> col:27 used y 'int' // CHECK-NEXT: | `-CompoundStmt {{.*}} <col:30, line:32:1> // CHECK-NEXT: | `-OMPTargetDirective {{.*}} <line:27:9, col:19> // CHECK-NEXT: | |-OMPFirstprivateClause {{.*}} <<invalid sloc>> <implicit> // CHECK-NEXT: | | |-DeclRefExpr {{.*}} <line:29:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | `-DeclRefExpr {{.*}} <line:30:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | `-CapturedStmt {{.*}} <line:28:9, col:59> // CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | |-CapturedStmt {{.*}} <col:9, col:59> // CHECK-NEXT: | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-OMPTeamsDistributeParallelForSimdDirective {{.*}} <col:9, col:59> openmp_structured_block // CHECK-NEXT: | | | | | |-OMPCollapseClause {{.*}} <col:48, col:58> // CHECK-NEXT: | | | | | | `-ConstantExpr {{.*}} <col:57> 'int' // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:57> 'int' 2 // CHECK-NEXT: | | | | | `-CapturedStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-CapturedStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | | | |-ForStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | | | | | | |-DeclStmt {{.*}} <line:29:8, col:17> // CHECK-NEXT: | | | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ForStmt {{.*}} <line:30:5, line:31:7> // CHECK-NEXT: | | | | | | | | | |-DeclStmt {{.*}} <line:30:10, col:19> // CHECK-NEXT: | | | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} <line:31:7> openmp_structured_block // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} <line:29:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <line:30:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | |-DeclRefExpr {{.*}} <line:29:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <line:30:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | | | |-FieldDecl {{.*}} <line:29:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | | | `-FieldDecl {{.*}} <line:30:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-ForStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:29:8, col:17> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ForStmt {{.*}} <line:30:5, line:31:7> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:30:10, col:19> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} <line:31:7> openmp_structured_block // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} <line:29:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <line:30:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | |-DeclRefExpr {{.*}} <line:29:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <line:30:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:27:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:27:9) *const restrict' // CHECK-NEXT: | | | | |-RecordDecl {{.*}} <line:28:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | |-FieldDecl {{.*}} <line:29:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | `-FieldDecl {{.*}} <line:30:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-CapturedStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | | |-ForStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | | | | | |-DeclStmt {{.*}} <line:29:8, col:17> // CHECK-NEXT: | | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ForStmt {{.*}} <line:30:5, line:31:7> // CHECK-NEXT: | | | | | | | | |-DeclStmt {{.*}} <line:30:10, col:19> // CHECK-NEXT: | | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} <line:31:7> openmp_structured_block // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} <line:29:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <line:30:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | |-DeclRefExpr {{.*}} <line:29:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <line:30:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | | |-FieldDecl {{.*}} <line:29:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | | `-FieldDecl {{.*}} <line:30:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-ForStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:29:8, col:17> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ForStmt {{.*}} <line:30:5, line:31:7> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:30:10, col:19> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} <line:31:7> openmp_structured_block // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} <line:29:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <line:30:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | |-OMPCapturedExprDecl {{.*}} <line:29:23> col:23 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | |-OMPCapturedExprDecl {{.*}} <line:30:25> col:25 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | `-OMPCapturedExprDecl {{.*}} <line:29:3, <invalid sloc>> col:3 implicit used .capture_expr. 'long' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} <col:3, <invalid sloc>> 'long' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:3, line:30:28> 'long' '*' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <line:29:3, col:26> 'long' <IntegralCast> // CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} <col:3, col:26> 'int' '/' // CHECK-NEXT: | | | | | | |-ParenExpr {{.*}} <col:3> 'int' // CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} <col:23, col:26> 'int' '+' // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:23, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} <col:23, col:16> 'int' '-' // CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <line:30:5, col:28> 'long' <IntegralCast> // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} <col:5, col:28> 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} <col:5> 'int' // CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} <col:25, col:28> 'int' '+' // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:25, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:25, col:18> 'int' '-' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:28> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:28> 'int' 1 // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <<invalid sloc>> 'long' <IntegralCast> // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} <line:29:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <line:30:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | |-AlwaysInlineAttr {{.*}} <<invalid sloc>> Implicit __forceinline // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:27:9> col:9 implicit .global_tid. 'const int' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .part_id. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .privates. 'void *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .copy_fn. 'void (*const restrict)(void *const restrict, ...)' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .task_t. 'void *const' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:27:9) *const restrict' // CHECK-NEXT: | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | |-FieldDecl {{.*}} <line:29:23> col:23 implicit 'int' // CHECK-NEXT: | | | | `-OMPCaptureKindAttr {{.*}} <<invalid sloc>> Implicit 9 // CHECK-NEXT: | | | `-FieldDecl {{.*}} <line:30:25> col:25 implicit 'int' // CHECK-NEXT: | | | `-OMPCaptureKindAttr {{.*}} <<invalid sloc>> Implicit 9 // CHECK-NEXT: | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | |-OMPTeamsDistributeParallelForSimdDirective {{.*}} <line:28:9, col:59> openmp_structured_block // CHECK-NEXT: | | | |-OMPCollapseClause {{.*}} <col:48, col:58> // CHECK-NEXT: | | | | `-ConstantExpr {{.*}} <col:57> 'int' // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:57> 'int' 2 // CHECK-NEXT: | | | `-CapturedStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-CapturedStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-ForStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:29:8, col:17> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ForStmt {{.*}} <line:30:5, line:31:7> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:30:10, col:19> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} <line:31:7> openmp_structured_block // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} <line:29:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <line:30:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | |-DeclRefExpr {{.*}} <line:29:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <line:30:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | |-FieldDecl {{.*}} <line:29:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | `-FieldDecl {{.*}} <line:30:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-ForStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:29:8, col:17> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ForStmt {{.*}} <line:30:5, line:31:7> // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:30:10, col:19> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-NullStmt {{.*}} <line:31:7> openmp_structured_block // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} <line:29:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | `-VarDecl {{.*}} <line:30:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} <line:29:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <line:30:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:27:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:27:9) *const restrict' // CHECK-NEXT: | | |-RecordDecl {{.*}} <line:28:9> col:9 implicit struct definition // CHECK-NEXT: | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | |-FieldDecl {{.*}} <line:29:23> col:23 implicit 'int &' // CHECK-NEXT: | | | `-FieldDecl {{.*}} <line:30:25> col:25 implicit 'int &' // CHECK-NEXT: | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | |-CapturedStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-ForStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:29:8, col:17> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ForStmt {{.*}} <line:30:5, line:31:7> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:30:10, col:19> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} <line:31:7> openmp_structured_block // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} <line:29:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <line:30:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | |-DeclRefExpr {{.*}} <line:29:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <line:30:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | |-FieldDecl {{.*}} <line:29:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | `-FieldDecl {{.*}} <line:30:25> col:25 implicit 'int &' // CHECK-NEXT: | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | |-ForStmt {{.*}} <line:29:3, line:31:7> // CHECK-NEXT: | | | | |-DeclStmt {{.*}} <line:29:8, col:17> // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-ForStmt {{.*}} <line:30:5, line:31:7> // CHECK-NEXT: | | | | |-DeclStmt {{.*}} <line:30:10, col:19> // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-NullStmt {{.*}} <line:31:7> openmp_structured_block // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <line:28:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:9) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} <line:29:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | `-VarDecl {{.*}} <line:30:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | |-OMPCapturedExprDecl {{.*}} <line:29:23> col:23 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | |-OMPCapturedExprDecl {{.*}} <line:30:25> col:25 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | `-OMPCapturedExprDecl {{.*}} <line:29:3, <invalid sloc>> col:3 implicit used .capture_expr. 'long' // CHECK-NEXT: | | `-BinaryOperator {{.*}} <col:3, <invalid sloc>> 'long' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} <col:3, line:30:28> 'long' '*' // CHECK-NEXT: | | | |-ImplicitCastExpr {{.*}} <line:29:3, col:26> 'long' <IntegralCast> // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} <col:3, col:26> 'int' '/' // CHECK-NEXT: | | | | |-ParenExpr {{.*}} <col:3> 'int' // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} <col:23, col:26> 'int' '+' // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:23, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:23, col:16> 'int' '-' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <line:30:5, col:28> 'long' <IntegralCast> // CHECK-NEXT: | | | `-BinaryOperator {{.*}} <col:5, col:28> 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} <col:5> 'int' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} <col:25, col:28> 'int' '+' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:25, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:25, col:18> 'int' '-' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:28> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:28> 'int' 1 // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} <<invalid sloc>> 'long' <IntegralCast> // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | |-DeclRefExpr {{.*}} <line:29:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | `-DeclRefExpr {{.*}} <line:30:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: `-FunctionDecl {{.*}} <line:34:1, line:41:1> line:34:6 test_five 'void (int, int, int)' // CHECK-NEXT: |-ParmVarDecl {{.*}} <col:16, col:20> col:20 used x 'int' // CHECK-NEXT: |-ParmVarDecl {{.*}} <col:23, col:27> col:27 used y 'int' // CHECK-NEXT: |-ParmVarDecl {{.*}} <col:30, col:34> col:34 used z 'int' // CHECK-NEXT: `-CompoundStmt {{.*}} <col:37, line:41:1> // CHECK-NEXT: `-OMPTargetDirective {{.*}} <line:35:9, col:19> // CHECK-NEXT: |-OMPFirstprivateClause {{.*}} <<invalid sloc>> <implicit> // CHECK-NEXT: | |-DeclRefExpr {{.*}} <line:37:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | |-DeclRefExpr {{.*}} <line:38:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | `-DeclRefExpr {{.*}} <line:39:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: `-CapturedStmt {{.*}} <line:36:9, col:59> // CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | |-CapturedStmt {{.*}} <col:9, col:59> // CHECK-NEXT: | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | |-OMPTeamsDistributeParallelForSimdDirective {{.*}} <col:9, col:59> openmp_structured_block // CHECK-NEXT: | | | | |-OMPCollapseClause {{.*}} <col:48, col:58> // CHECK-NEXT: | | | | | `-ConstantExpr {{.*}} <col:57> 'int' // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:57> 'int' 2 // CHECK-NEXT: | | | | `-CapturedStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-CapturedStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | | |-ForStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | | | | | | |-DeclStmt {{.*}} <line:37:8, col:17> // CHECK-NEXT: | | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ForStmt {{.*}} <line:38:5, line:40:9> // CHECK-NEXT: | | | | | | | | |-DeclStmt {{.*}} <line:38:10, col:19> // CHECK-NEXT: | | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ForStmt {{.*}} <line:39:7, line:40:9> openmp_structured_block // CHECK-NEXT: | | | | | | | | |-DeclStmt {{.*}} <line:39:12, col:21> // CHECK-NEXT: | | | | | | | | | `-VarDecl {{.*}} <col:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} <col:23, col:27> 'int' '<' // CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | | `-ImplicitCastExpr {{.*}} <col:27> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | | | | | | |-UnaryOperator {{.*}} <col:30, col:31> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:30> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} <line:40:9> // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} <line:37:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} <line:38:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <line:39:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | | | | |-DeclRefExpr {{.*}} <line:37:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-DeclRefExpr {{.*}} <line:38:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <line:39:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | | |-FieldDecl {{.*}} <line:37:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | | |-FieldDecl {{.*}} <line:38:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | | | `-FieldDecl {{.*}} <line:39:27> col:27 implicit 'int &' // CHECK-NEXT: | | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-ForStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:37:8, col:17> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ForStmt {{.*}} <line:38:5, line:40:9> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:38:10, col:19> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ForStmt {{.*}} <line:39:7, line:40:9> openmp_structured_block // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:39:12, col:21> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:23, col:27> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:27> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:30, col:31> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:30> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} <line:40:9> // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} <line:37:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | |-VarDecl {{.*}} <line:38:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <line:39:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | | |-DeclRefExpr {{.*}} <line:37:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | |-DeclRefExpr {{.*}} <line:38:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <line:39:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <line:35:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:35:9) *const restrict' // CHECK-NEXT: | | | |-RecordDecl {{.*}} <line:36:9> col:9 implicit struct definition // CHECK-NEXT: | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | |-FieldDecl {{.*}} <line:37:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | |-FieldDecl {{.*}} <line:38:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | `-FieldDecl {{.*}} <line:39:27> col:27 implicit 'int &' // CHECK-NEXT: | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-CapturedStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | | |-ForStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:37:8, col:17> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ForStmt {{.*}} <line:38:5, line:40:9> // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:38:10, col:19> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ForStmt {{.*}} <line:39:7, line:40:9> openmp_structured_block // CHECK-NEXT: | | | | | | | |-DeclStmt {{.*}} <line:39:12, col:21> // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} <col:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:23, col:27> 'int' '<' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | | `-ImplicitCastExpr {{.*}} <col:27> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | | | | | |-UnaryOperator {{.*}} <col:30, col:31> 'int' postfix '++' // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:30> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} <line:40:9> // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} <line:37:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} <line:38:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <line:39:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | | | |-DeclRefExpr {{.*}} <line:37:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | |-DeclRefExpr {{.*}} <line:38:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <line:39:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | | |-FieldDecl {{.*}} <line:37:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | | |-FieldDecl {{.*}} <line:38:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | | `-FieldDecl {{.*}} <line:39:27> col:27 implicit 'int &' // CHECK-NEXT: | | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-ForStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:37:8, col:17> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ForStmt {{.*}} <line:38:5, line:40:9> // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:38:10, col:19> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ForStmt {{.*}} <line:39:7, line:40:9> openmp_structured_block // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:39:12, col:21> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:23, col:27> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:27> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:30, col:31> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:30> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-NullStmt {{.*}} <line:40:9> // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} <line:37:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | |-VarDecl {{.*}} <line:38:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | `-VarDecl {{.*}} <line:39:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | |-OMPCapturedExprDecl {{.*}} <line:37:23> col:23 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | |-OMPCapturedExprDecl {{.*}} <line:38:25> col:25 implicit used .capture_expr. 'int' // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | `-OMPCapturedExprDecl {{.*}} <line:37:3, <invalid sloc>> col:3 implicit used .capture_expr. 'long' // CHECK-NEXT: | | | `-BinaryOperator {{.*}} <col:3, <invalid sloc>> 'long' '-' // CHECK-NEXT: | | | |-BinaryOperator {{.*}} <col:3, line:38:28> 'long' '*' // CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} <line:37:3, col:26> 'long' <IntegralCast> // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} <col:3, col:26> 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} <col:3> 'int' // CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} <col:23, col:26> 'int' '+' // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:23, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} <col:23, col:16> 'int' '-' // CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <line:38:5, col:28> 'long' <IntegralCast> // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} <col:5, col:28> 'int' '/' // CHECK-NEXT: | | | | |-ParenExpr {{.*}} <col:5> 'int' // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} <col:25, col:28> 'int' '+' // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:25, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:25, col:18> 'int' '-' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:28> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:28> 'int' 1 // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <<invalid sloc>> 'long' <IntegralCast> // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | |-DeclRefExpr {{.*}} <line:37:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | |-DeclRefExpr {{.*}} <line:38:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | `-DeclRefExpr {{.*}} <line:39:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | |-AlwaysInlineAttr {{.*}} <<invalid sloc>> Implicit __forceinline // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} <line:35:9> col:9 implicit .global_tid. 'const int' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .part_id. 'const int *const restrict' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .privates. 'void *const restrict' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .copy_fn. 'void (*const restrict)(void *const restrict, ...)' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .task_t. 'void *const' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:35:9) *const restrict' // CHECK-NEXT: | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | |-FieldDecl {{.*}} <line:37:23> col:23 implicit 'int' // CHECK-NEXT: | | | `-OMPCaptureKindAttr {{.*}} <<invalid sloc>> Implicit 9 // CHECK-NEXT: | | |-FieldDecl {{.*}} <line:38:25> col:25 implicit 'int' // CHECK-NEXT: | | | `-OMPCaptureKindAttr {{.*}} <<invalid sloc>> Implicit 9 // CHECK-NEXT: | | `-FieldDecl {{.*}} <line:39:27> col:27 implicit 'int' // CHECK-NEXT: | | `-OMPCaptureKindAttr {{.*}} <<invalid sloc>> Implicit 9 // CHECK-NEXT: | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | |-OMPTeamsDistributeParallelForSimdDirective {{.*}} <line:36:9, col:59> openmp_structured_block // CHECK-NEXT: | | |-OMPCollapseClause {{.*}} <col:48, col:58> // CHECK-NEXT: | | | `-ConstantExpr {{.*}} <col:57> 'int' // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:57> 'int' 2 // CHECK-NEXT: | | `-CapturedStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | |-CapturedStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | | |-ForStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:37:8, col:17> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ForStmt {{.*}} <line:38:5, line:40:9> // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:38:10, col:19> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ForStmt {{.*}} <line:39:7, line:40:9> openmp_structured_block // CHECK-NEXT: | | | | | | |-DeclStmt {{.*}} <line:39:12, col:21> // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} <col:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} <col:23, col:27> 'int' '<' // CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | | `-ImplicitCastExpr {{.*}} <col:27> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | | | | |-UnaryOperator {{.*}} <col:30, col:31> 'int' postfix '++' // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:30> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} <line:40:9> // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} <line:37:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | |-VarDecl {{.*}} <line:38:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <line:39:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | | |-DeclRefExpr {{.*}} <line:37:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | |-DeclRefExpr {{.*}} <line:38:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <line:39:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | | |-FieldDecl {{.*}} <line:37:23> col:23 implicit 'int &' // CHECK-NEXT: | | | | |-FieldDecl {{.*}} <line:38:25> col:25 implicit 'int &' // CHECK-NEXT: | | | | `-FieldDecl {{.*}} <line:39:27> col:27 implicit 'int &' // CHECK-NEXT: | | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | |-ForStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | | |-DeclStmt {{.*}} <line:37:8, col:17> // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-ForStmt {{.*}} <line:38:5, line:40:9> // CHECK-NEXT: | | | | |-DeclStmt {{.*}} <line:38:10, col:19> // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-ForStmt {{.*}} <line:39:7, line:40:9> openmp_structured_block // CHECK-NEXT: | | | | |-DeclStmt {{.*}} <line:39:12, col:21> // CHECK-NEXT: | | | | | `-VarDecl {{.*}} <col:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:23, col:27> 'int' '<' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} <col:27> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | | |-UnaryOperator {{.*}} <col:30, col:31> 'int' postfix '++' // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:30> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-NullStmt {{.*}} <line:40:9> // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} <line:37:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | |-VarDecl {{.*}} <line:38:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | `-VarDecl {{.*}} <line:39:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | |-DeclRefExpr {{.*}} <line:37:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | |-DeclRefExpr {{.*}} <line:38:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | `-DeclRefExpr {{.*}} <line:39:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} <line:35:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:35:9) *const restrict' // CHECK-NEXT: | |-RecordDecl {{.*}} <line:36:9> col:9 implicit struct definition // CHECK-NEXT: | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | |-FieldDecl {{.*}} <line:37:23> col:23 implicit 'int &' // CHECK-NEXT: | | |-FieldDecl {{.*}} <line:38:25> col:25 implicit 'int &' // CHECK-NEXT: | | `-FieldDecl {{.*}} <line:39:27> col:27 implicit 'int &' // CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | |-CapturedStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | | | |-ForStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:37:8, col:17> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ForStmt {{.*}} <line:38:5, line:40:9> // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:38:10, col:19> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-ForStmt {{.*}} <line:39:7, line:40:9> openmp_structured_block // CHECK-NEXT: | | | | | |-DeclStmt {{.*}} <line:39:12, col:21> // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} <col:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | | | |-<<<NULL>>> // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:23, col:27> 'int' '<' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} <col:27> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | | | |-UnaryOperator {{.*}} <col:30, col:31> 'int' postfix '++' // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:30> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | | `-NullStmt {{.*}} <line:40:9> // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} <line:37:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | |-VarDecl {{.*}} <line:38:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | `-VarDecl {{.*}} <line:39:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} <line:37:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} <line:38:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <line:39:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | |-RecordDecl {{.*}} <col:9> col:9 implicit struct definition // CHECK-NEXT: | | | |-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: | | | |-FieldDecl {{.*}} <line:37:23> col:23 implicit 'int &' // CHECK-NEXT: | | | |-FieldDecl {{.*}} <line:38:25> col:25 implicit 'int &' // CHECK-NEXT: | | | `-FieldDecl {{.*}} <line:39:27> col:27 implicit 'int &' // CHECK-NEXT: | | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | | |-ForStmt {{.*}} <line:37:3, line:40:9> // CHECK-NEXT: | | | |-DeclStmt {{.*}} <line:37:8, col:17> // CHECK-NEXT: | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | |-<<<NULL>>> // CHECK-NEXT: | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<' // CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | `-ForStmt {{.*}} <line:38:5, line:40:9> // CHECK-NEXT: | | | |-DeclStmt {{.*}} <line:38:10, col:19> // CHECK-NEXT: | | | | `-VarDecl {{.*}} <col:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | |-<<<NULL>>> // CHECK-NEXT: | | | |-BinaryOperator {{.*}} <col:21, col:25> 'int' '<' // CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} <col:21> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:21> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | | | |-UnaryOperator {{.*}} <col:28, col:29> 'int' postfix '++' // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:28> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | `-ForStmt {{.*}} <line:39:7, line:40:9> openmp_structured_block // CHECK-NEXT: | | | |-DeclStmt {{.*}} <line:39:12, col:21> // CHECK-NEXT: | | | | `-VarDecl {{.*}} <col:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | | | |-<<<NULL>>> // CHECK-NEXT: | | | |-BinaryOperator {{.*}} <col:23, col:27> 'int' '<' // CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <col:27> 'int' <LValueToRValue> // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:27> 'int' lvalue ParmVar {{.*}} 'z' 'int' // CHECK-NEXT: | | | |-UnaryOperator {{.*}} <col:30, col:31> 'int' postfix '++' // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:30> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | `-NullStmt {{.*}} <line:40:9> // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:36:9> col:9 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit .bound_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.lb. 'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit used .previous.ub. 'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <col:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:9) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} <line:37:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | |-VarDecl {{.*}} <line:38:10, col:18> col:14 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | `-VarDecl {{.*}} <line:39:12, col:20> col:16 used i 'int' cinit // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:20> 'int' 0 // CHECK-NEXT: | |-OMPCapturedExprDecl {{.*}} <line:37:23> col:23 implicit used .capture_expr. 'int' // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: | |-OMPCapturedExprDecl {{.*}} <line:38:25> col:25 implicit used .capture_expr. 'int' // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: | `-OMPCapturedExprDecl {{.*}} <line:37:3, <invalid sloc>> col:3 implicit used .capture_expr. 'long' // CHECK-NEXT: | `-BinaryOperator {{.*}} <col:3, <invalid sloc>> 'long' '-' // CHECK-NEXT: | |-BinaryOperator {{.*}} <col:3, line:38:28> 'long' '*' // CHECK-NEXT: | | |-ImplicitCastExpr {{.*}} <line:37:3, col:26> 'long' <IntegralCast> // CHECK-NEXT: | | | `-BinaryOperator {{.*}} <col:3, col:26> 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} <col:3> 'int' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} <col:23, col:26> 'int' '+' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:23, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} <col:23, col:16> 'int' '-' // CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:26> 'int' 1 // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} <line:38:5, col:28> 'long' <IntegralCast> // CHECK-NEXT: | | `-BinaryOperator {{.*}} <col:5, col:28> 'int' '/' // CHECK-NEXT: | | |-ParenExpr {{.*}} <col:5> 'int' // CHECK-NEXT: | | | `-BinaryOperator {{.*}} <col:25, col:28> 'int' '+' // CHECK-NEXT: | | | |-BinaryOperator {{.*}} <col:25, <invalid sloc>> 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} <col:25, col:18> 'int' '-' // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} <col:25> 'int' <LValueToRValue> // CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} <col:25> 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <col:18> 'int' 0 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:28> 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:28> 'int' 1 // CHECK-NEXT: | `-ImplicitCastExpr {{.*}} <<invalid sloc>> 'long' <IntegralCast> // CHECK-NEXT: | `-IntegerLiteral {{.*}} <<invalid sloc>> 'int' 1 // CHECK-NEXT: |-DeclRefExpr {{.*}} <line:37:23> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: |-DeclRefExpr {{.*}} <line:38:25> 'int' lvalue ParmVar {{.*}} 'y' 'int' // CHECK-NEXT: `-DeclRefExpr {{.*}} <line:39:27> 'int' lvalue ParmVar {{.*}} 'z' 'int'
the_stack_data/154845.c
int f(int x, int y) { y = 0; while (1) { if (x <= 50) y++; else y--; if (y < 0) break; //x++; } }
the_stack_data/68887978.c
#include <unistd.h> #include <stdlib.h> #include <stdio.h> main(){ // 接受子进程 pid 的值 pid_t id; // 系统调用 id = fork(); // 进程创建失败,返回值为 -1 if (id<0) { perror("fork"); exit(1); } // 创建成功 id = 0,为子进程 else if (id==0) { printf("I am child, my pid = %d\n", getpid()); } else { printf("I am parent, my pid is %d \n", getpid()); } printf("%d print this sentence \n", getpid()); }
the_stack_data/295566.c
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> /** * Writes the error message (for the current errno) to the console, as well as the (optional) * detail string, to standard error. */ void perror(const char *s) { if(s) { fprintf(stderr, "perror: errno = %s (%d): %s\n", strerror(errno), errno, s); } else { fprintf(stderr, "perror: errno = %s (%d)\n", strerror(errno), errno); } }
the_stack_data/159514495.c
#include<stdio.h> #include<stdlib.h> int main() { int a[] = {2, 4, 5, 4, 6}; int n; printf("Enter an element position to delete:\n"); scanf("%d", &n); printf("\n"); a[n] = a[n + 1]; a[n + 1] = a[n + 2]; a[n + 2] = a[n + 3]; // a[n + 3] = a[n + 4]; int i; for(i = 0; i < 5; i++){ printf("%d\n", a[i]); } }
the_stack_data/65876.c
// Test with pch. // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/tentative-defs.h // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t.pch -verify -emit-llvm -o %t %s // RUN: grep "@variable = common global i32 0" %t | count 1 // RUN: grep "@incomplete_array = common global .*1 x i32" %t | count 1 // FIXME: tentative-defs.h expected-warning{{tentative}}
the_stack_data/90764655.c
#include <stdio.h> double f (int x) { return 1.0 / x; } int main () { double a, b; int i; a = f(10); // 0.1 无法精确表示,float a store 进内存(80 =› 64),之后再 load 出来进栈顶(64 =› 80),被舍入过。 b = f(10); i = a == b; printf("%d\n", i); double c, d, e; int j; c = f(10); d = f(10); // a b 同时都被一个方法舍入过 e = f(10); j = c == d; printf("%d\n", j); } // 老版本 gcc - O2 // 0 // 1
the_stack_data/9511984.c
/* ----------------------------------------------------------------------------- * * (c) The GHC Team, 1998-2017 * * Generating cost-centre profiler JSON report * * ---------------------------------------------------------------------------*/ #if defined(PROFILING) #include "PosixSource.h" #include "Rts.h" #include "RtsUtils.h" #include "ProfilerReportJson.h" #include "Profiling.h" #include <string.h> // I don't think this code is all that perf critical. // So we just allocate a new buffer each time around. static void escapeString(char const* str, char **buf) { char *out; size_t req_size; //Max required size for decoding. size_t in_size; //Input size, including zero. in_size = strlen(str) + 1; // The strings are generally small and short // lived so should be ok to just double the size. req_size = in_size * 2; out = stgMallocBytes(req_size, "writeCCSReportJson"); *buf = out; // We provide an outputbuffer twice the size of the input, // and at worse double the output size. So we can skip // length checks. for (; *str != '\0'; str++) { char c = *str; if (c == '\\') { *out = '\\'; out++; *out = '\\'; out++; } else if (c == '\n') { *out = '\\'; out++; *out = 'n'; out++; } else { *out = c; out++; } } *out = '\0'; } static void logCostCentres(FILE *prof_file) { char* lbl; char* src_loc; bool needs_comma = false; fprintf(prof_file, "[\n"); for (CostCentre *cc = CC_LIST; cc != NULL; cc = cc->link) { escapeString(cc->label, &lbl); escapeString(cc->srcloc, &src_loc); fprintf(prof_file, "%s" "{\"id\": %" FMT_Int ", " "\"label\": \"%s\", " "\"module\": \"%s\", " "\"src_loc\": \"%s\", " "\"is_caf\": %s}", needs_comma ? ", " : "", cc->ccID, lbl, cc->module, src_loc, cc->is_caf ? "true" : "false"); needs_comma = true; } fprintf(prof_file, "]\n"); stgFree(lbl); stgFree(src_loc); } static void logCostCentreStack(FILE *prof_file, CostCentreStack const *ccs) { fprintf(prof_file, "{\"id\": %" FMT_Int ", " "\"entries\": %" FMT_Word64 ", " "\"alloc\": %" FMT_Word64 ", " "\"ticks\": %" FMT_Word ", ", ccs->cc->ccID, ccs->scc_count, ccs->mem_alloc * sizeof(W_), ccs->time_ticks); bool need_comma = false; fprintf(prof_file, "\"children\": ["); for (IndexTable *i = ccs->indexTable; i != 0; i = i->next) { if (!i->back_edge) { if (need_comma) { fprintf(prof_file, ","); } logCostCentreStack(prof_file, i->ccs); need_comma = true; } } fprintf(prof_file, "]}\n"); } void writeCCSReportJson(FILE *prof_file, CostCentreStack const *stack, ProfilerTotals totals) { fprintf(prof_file, "{\n\"program\": \"%s\",\n", prog_name); fprintf(prof_file, "\"arguments\": ["); for (int count = 0; prog_argv[count]; count++) { char* arg; escapeString(prog_argv[count], &arg); fprintf(prof_file, "%s\"%s\"", count == 0 ? "" : ", ", arg); stgFree(arg); } fprintf(prof_file, "],\n\"rts_arguments\": ["); for (int count = 0; rts_argv[count]; count++) { char* arg; escapeString(rts_argv[count], &arg); fprintf(prof_file, "%s\"%s\"", count == 0 ? "" : ", ", arg); stgFree(arg); } fprintf(prof_file, "],\n"); fprintf(prof_file, "\"end_time\": \"%s\",\n", time_str()); fprintf(prof_file, "\"initial_capabilities\": %d,\n", RtsFlags.ParFlags.nCapabilities); fprintf(prof_file, "\"total_time\": %11.2f,\n", ((double) totals.total_prof_ticks * (double) RtsFlags.MiscFlags.tickInterval) / (TIME_RESOLUTION * n_capabilities)); fprintf(prof_file, "\"total_ticks\": %lu,\n", (unsigned long) totals.total_prof_ticks); fprintf(prof_file, "\"tick_interval\": %d,\n", (int) TimeToUS(RtsFlags.MiscFlags.tickInterval)); fprintf(prof_file, "\"total_alloc\":%" FMT_Word64 ",\n", totals.total_alloc * sizeof(W_)); fprintf(prof_file, "\"cost_centres\": "); logCostCentres(prof_file); fprintf(prof_file, ",\n\"profile\": "); logCostCentreStack(prof_file, stack); fprintf(prof_file, "}\n"); } #endif /* PROFILING */
the_stack_data/48574556.c
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is the Netscape security libraries. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1994-2000 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ // This file exists to provide the secure memcmp function. This was added in // NSS 3.12.5. #include <stdlib.h> /* * Perform a constant-time compare of two memory regions. The return value is * 0 if the memory regions are equal and non-zero otherwise. */ int NSS_SecureMemcmp(const void *ia, const void *ib, size_t n) { const unsigned char *a = (const unsigned char*) ia; const unsigned char *b = (const unsigned char*) ib; size_t i; unsigned char r = 0; for (i = 0; i < n; ++i) { r |= *a++ ^ *b++; } return r; }
the_stack_data/542121.c
/* checks if (no1)^(no2)= no3 */ #include <stdio.h> #include <stdlib.h> #include <math.h> typedef enum {false=0, true=1}bool; bool CheckPower(int no1, int no2, int no3); int main(int argc, char *argv[]) { int no1, no2, no3; bool result; printf("Enter three numbers: "); scanf("%d %d %d", &no1, &no2, &no3); result=CheckPower(no1, no2, no3); if(result) printf("(%d)^(%d)= %d \n", no1, no2, no3); else printf("(%d)^(%d) is not %d \n", no1, no2, no3); return 0; } bool CheckPower(int no1, int no2, int no3) { if (pow(no1,no2)==no3) return(true); else return(false); }
the_stack_data/105785.c
#include <search.h> #include <string.h> void *lsearch(const void *key, void *base, size_t *nelp, size_t width, int (*compar)(const void *, const void *)) { char* elem = lfind(key, base, nelp, width, compar); if(elem == NULL) { elem = base; elem += (*nelp)++ * width; memcpy(elem, key, width); } return elem; }
the_stack_data/70449997.c
#include <fenv.h> #include <math.h> extern void __VERIFIER_error() __attribute__ ((__noreturn__)); void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: __VERIFIER_error(); } return; } int main(void) { int const modes[] = {FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD}; for (int i = 0; i < sizeof(modes) / sizeof(int); ++i) { fesetround(modes[i]); switch (modes[i]) { case FE_DOWNWARD: __VERIFIER_assert(rint(12.9) == 12.); __VERIFIER_assert(rint(-12.1) == -13.); break; case FE_TONEAREST: __VERIFIER_assert(rint(12.4) == 12.); __VERIFIER_assert(rint(-12.4) == -12.); break; case FE_TOWARDZERO: __VERIFIER_assert(rint(12.9) == 12.); __VERIFIER_assert(rint(-12.9) == -12.); break; case FE_UPWARD: __VERIFIER_assert(rint(12.1) == 13.); __VERIFIER_assert(rint(-12.9) == -12.); break; } } fesetround(FE_DOWNWARD); __VERIFIER_assert(rint(12.9) == 12.); __VERIFIER_assert(rint(-12.1) == -13.); fesetround(FE_TONEAREST); __VERIFIER_assert(rint(12.4) == 12.); __VERIFIER_assert(rint(-12.4) == -12.); fesetround(FE_TOWARDZERO); __VERIFIER_assert(rint(12.9) == 12.); __VERIFIER_assert(rint(-12.9) == -12.); fesetround(FE_UPWARD); __VERIFIER_assert(rint(12.1) == 13.); __VERIFIER_assert(rint(-12.9) == -12.); return 0; }
the_stack_data/231392595.c
#include<stdio.h> int main(){ /*int a=1, b=10; do { b-=a; a++; } while (b--<0); printf("b= %d\n",b); */ //int x=10,y=3; //printf("y=%d\n",y=x/y); int x,y; char a,b,c; // scanf("%d %d",&x,&y);a=getchar();b=getchar();c=getchar(); scanf("%d%d%c%c%c%c%c%c",&x,&y,&a,&a,&b,&b,&c,&c); printf("x=%d y=%d a=%c b=%c c=%c\n",x,y,a,b,c); return 0; }
the_stack_data/149511.c
/* { dg-add-options stack_size } */ struct parsefile { long fd; char *buf; }; struct parsefile basepf; struct parsefile *parsefile = &basepf; #ifdef STACK_SIZE int filler[STACK_SIZE / (2*sizeof(int))]; #else int filler[0x3000]; #endif int el; char * g1 (a, b) int a; int *b; { } g2 (a) long a; { if (a != 0xdeadbeefL) abort (); exit (0); } f () { register char *p, *q; register int i; register int something; if (parsefile->fd == 0L && el) { const char *rl_cp; int len; rl_cp = g1 (el, &len); strcpy (p, rl_cp); } else { alabel: i = g2 (parsefile->fd); } } main () { el = 0; parsefile->fd = 0xdeadbeefL; f (); }
the_stack_data/87128.c
/* PR tree-optimization/82388 */ struct A { int b; int c; int d; } e; struct A foo (void) { struct A h[30] = {{0,0,0}}; return h[29]; } int main () { e = foo (); return e.b; }
the_stack_data/406048.c
#include <stdlib.h> #include <stdio.h> typedef struct Node { int data; struct Node* next; }Node; Node* insert(Node *head,int data) { Node* Newnode; Newnode = (Node *)malloc(sizeof(Node)); Newnode->data = data; Newnode->next = NULL; if(head == NULL){ head = Newnode; return head; }else{ Node* cur = head; while(cur->next) cur= cur->next; cur->next = Newnode; } return head; } void display(Node *head) { Node *start=head; while(start) { printf("%d ",start->data); start=start->next; } } int main() { int T,data; scanf("%d",&T); Node *head=NULL; while(T-->0){ scanf("%d",&data); head=insert(head,data); } display(head); }
the_stack_data/111077067.c
#include <stdio.h> int main(void){ float diametr=113, dlina=355; float pi=0; pi = dlina/diametr; printf("pi = %.5f\n",pi); return 0; } // выведение числа пи
the_stack_data/76699965.c
/* * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). * You may select, at your option, one of the above-listed licenses. */ #include <stdlib.h> // malloc, free, exit #include <stdio.h> // fprintf, perror, feof, fopen, etc. #include <string.h> // strlen, memset, strcat #include <zstd.h> // presumes zstd library is installed static void* malloc_orDie(size_t size) { void* const buff = malloc(size); if (buff) return buff; /* error */ perror("malloc:"); exit(1); } static FILE* fopen_orDie(const char *filename, const char *instruction) { FILE* const inFile = fopen(filename, instruction); if (inFile) return inFile; /* error */ perror(filename); exit(3); } static size_t fread_orDie(void* buffer, size_t sizeToRead, FILE* file) { size_t const readSize = fread(buffer, 1, sizeToRead, file); if (readSize == sizeToRead) return readSize; /* good */ if (feof(file)) return readSize; /* good, reached end of file */ /* error */ perror("fread"); exit(4); } static size_t fwrite_orDie(const void* buffer, size_t sizeToWrite, FILE* file) { size_t const writtenSize = fwrite(buffer, 1, sizeToWrite, file); if (writtenSize == sizeToWrite) return sizeToWrite; /* good */ /* error */ perror("fwrite"); exit(5); } static size_t fclose_orDie(FILE* file) { if (!fclose(file)) return 0; /* error */ perror("fclose"); exit(6); } static void compressFile_orDie(const char* fname, const char* outName, int cLevel) { FILE* const fin = fopen_orDie(fname, "rb"); FILE* const fout = fopen_orDie(outName, "wb"); size_t const buffInSize = ZSTD_CStreamInSize(); /* can always read one full block */ void* const buffIn = malloc_orDie(buffInSize); size_t const buffOutSize = ZSTD_CStreamOutSize(); /* can always flush a full block */ void* const buffOut = malloc_orDie(buffOutSize); ZSTD_CStream* const cstream = ZSTD_createCStream(); if (cstream==NULL) { fprintf(stderr, "ZSTD_createCStream() error \n"); exit(10); } size_t const initResult = ZSTD_initCStream(cstream, cLevel); if (ZSTD_isError(initResult)) { fprintf(stderr, "ZSTD_initCStream() error : %s \n", ZSTD_getErrorName(initResult)); exit(11); } size_t read, toRead = buffInSize; while( (read = fread_orDie(buffIn, toRead, fin)) ) { ZSTD_inBuffer input = { buffIn, read, 0 }; while (input.pos < input.size) { ZSTD_outBuffer output = { buffOut, buffOutSize, 0 }; toRead = ZSTD_compressStream(cstream, &output , &input); /* toRead is guaranteed to be <= ZSTD_CStreamInSize() */ if (ZSTD_isError(toRead)) { fprintf(stderr, "ZSTD_compressStream() error : %s \n", ZSTD_getErrorName(toRead)); exit(12); } if (toRead > buffInSize) toRead = buffInSize; /* Safely handle case when `buffInSize` is manually changed to a value < ZSTD_CStreamInSize()*/ fwrite_orDie(buffOut, output.pos, fout); } } ZSTD_outBuffer output = { buffOut, buffOutSize, 0 }; size_t const remainingToFlush = ZSTD_endStream(cstream, &output); /* close frame */ if (remainingToFlush) { fprintf(stderr, "not fully flushed"); exit(13); } fwrite_orDie(buffOut, output.pos, fout); ZSTD_freeCStream(cstream); fclose_orDie(fout); fclose_orDie(fin); free(buffIn); free(buffOut); } static const char* createOutFilename_orDie(const char* filename) { size_t const inL = strlen(filename); size_t const outL = inL + 5; void* outSpace = malloc_orDie(outL); memset(outSpace, 0, outL); strcat(outSpace, filename); strcat(outSpace, ".zst"); return (const char*)outSpace; } int main(int argc, const char** argv) { const char* const exeName = argv[0]; if (argc!=2) { printf("wrong arguments\n"); printf("usage:\n"); printf("%s FILE\n", exeName); return 1; } const char* const inFilename = argv[1]; const char* const outFilename = createOutFilename_orDie(inFilename); compressFile_orDie(inFilename, outFilename, 1); return 0; }
the_stack_data/9512614.c
#include <stdio.h> int main(void) { int input; scanf(" %d", &input); printf("%d", input); return 0; }
the_stack_data/32949928.c
#ifdef USE_NETROM #include <stdlib.h> #include <netrom/netrom.h> #include "net.h" #include "compat.h" #include "random.h" #include "utils.h" // RAND_ARRAY static void netrom_setsockopt(struct sockopt *so, __unused__ struct socket_triplet *triplet) { const unsigned int netrom_opts[] = { NETROM_T1, NETROM_T2, NETROM_N2, NETROM_T4, NETROM_IDLE }; so->level = SOL_NETROM; so->optname = RAND_ARRAY(netrom_opts); } static struct socket_triplet netrom_triplet[] = { { .family = PF_NETROM, .protocol = 0, .type = SOCK_SEQPACKET }, }; const struct netproto proto_netrom = { .name = "netrom", // .socket = netrom_rand_socket, .setsockopt = netrom_setsockopt, .valid_triplets = netrom_triplet, .nr_triplets = ARRAY_SIZE(netrom_triplet), }; #endif
the_stack_data/31388818.c
/** * This file has no copyright assigned and is placed in the Public Domain. * This file is part of the mingw-w64 runtime package. * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ #include <stdarg.h> #include <wchar.h> extern int __ms_vswscanf_internal ( const wchar_t * s, const wchar_t * format, va_list arg, int (*func)(const wchar_t * __restrict__, const wchar_t * __restrict__, ...)) asm("__argtos"); int __ms_vswscanf(const wchar_t * __restrict__ s, const wchar_t * __restrict__ format, va_list arg) { int ret; #if defined(_AMD64_) || defined(__x86_64__) || \ defined(_X86_) || defined(__i386__) || \ defined(_ARM_) || defined(__arm__) || \ defined(_ARM64_) || defined(__aarch64__) ret = __ms_vswscanf_internal (s, format, arg, swscanf); #else #error "unknown platform" #endif return ret; }
the_stack_data/1110186.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_print_reverse_alphabet.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: gcusuman <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/10/22 16:36:28 by gcusuman #+# #+# */ /* Updated: 2020/10/22 16:44:05 by gcusuman ### ########.fr */ /* */ /* ************************************************************************** */ #include <unistd.h> void ft_print_reverse_alphabet(void) { write(1, "zyxwvutsrqponmlkjihgfedcba", 26); }
the_stack_data/106815.c
#include <stdio.h> #include <stdbool.h> #include <stdlib.h> typedef struct instructions{ char input[10]; struct instructions *next; }instructions; bool is_stop(char input[]) { if (atoi(input) == 99999) { return true; } return false; } bool is_even(char result[]) { if ( (((result[0]) - '0') + ((result[1])) - '0') % 2 == 0 ) { return true; }else { return false; } } void right(char input[], int size) { char temp[size]; int i = 0; while (input[i+2] != '\0') { temp[i] = input[i+2]; if (input[i+3] == '\0') { temp[i+1] = '\0'; } i++; } printf("right %d\n", atoi(temp)); } void left(char input[], int size) { char temp[size]; int i = 0; while (input[i+2] != '\0') { temp[i] = input[i+2]; if (input[i+3] == '\0') { temp[i+1] = '\0'; } i++; } printf("left %d\n", atoi(temp)); } void answer(bool temp, char input[], int size) { if (temp) { right(input, size); }else { left(input, size); } } int main() { instructions head; instructions *turning = &head; while (turning != NULL) { scanf("%s", turning->input); if (is_stop(turning->input)) { turning->next = NULL; break; } turning -> next = (instructions *)malloc(sizeof(instructions)); turning = turning->next; } instructions *result = &head; int temp = 1; while (result->next != NULL) { if (is_stop(result->input)) { exit(0); }else if ( (((result->input[0]) -'0') == 0) && (((result->input[1]) - '0') == 0) ) { answer(temp, result->input, sizeof(result->input)/sizeof(char)); }else if (is_even(result->input)) { temp = 1; answer(temp, result->input, sizeof(result->input)/sizeof(char)); }else { temp = 0; answer(temp, result->input, sizeof(result->input)/sizeof(char)); } result = result->next; } return 0; }
the_stack_data/14199965.c
/* * Copyright (C) 2011 Marcelina Kościelnicka <[email protected]> * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include <stdio.h> #include <string.h> #include <stdlib.h> FILE *open_input(const char *filename) { const char * const tab[][2] = { { ".gz", "zcat" }, { ".Z", "zcat" }, { ".bz2", "bzcat" }, { ".xz", "xzcat" }, }; int i; int flen = strlen(filename); for (i = 0; i < sizeof tab / sizeof tab[0]; i++) { int elen = strlen(tab[i][0]); if (flen > elen && !strcmp(filename + flen - elen, tab[i][0])) { char *cmd = malloc(flen + strlen(tab[i][1]) + 2); FILE *res; strcpy(cmd, tab[i][1]); strcat(cmd, " "); strcat(cmd, filename); res = popen(cmd, "r"); free(cmd); return res; } } return fopen(filename, "r"); }
the_stack_data/973176.c
/* This testcase is part of GDB, the GNU debugger. Copyright 2018-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ static int __attribute__ ((used)) foo (void) { return 2; } int main (void) { return 0; }